home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / Technical Docs / MPW 411 / MPWHelp < prev    next >
Encoding:
Text File  |  1992-02-07  |  377.2 KB  |  10,719 lines  |  [TEXT/MPS ]

  1. æKY CopyrightNotice
  2. æC  Copyright Apple Computer, Inc. 1986-1991, All rights reserved.
  3. 411 - MPW Help - MPW QR4.
  4. Wednesday, August 14, 1991 10:14:22 AM
  5.  
  6. MPW 3.2 Help Summaries
  7.  Help information is available for each of the MPW commands.  
  8.  To see the list of commands select Help and type command - 1. In addition, 
  9.  brief descriptions of Expressions, Patterns, Selections, Characters,
  10.  Shortcuts, Variables, and Projector are also included.
  11.  
  12.  To see Help summaries, Select one of the following and type command - 1
  13.  
  14.  a commandName  # information about commandName
  15.  Commands       # a list of commands
  16.  Expressions    # summary of expressions
  17.  Patterns       # summary of patterns (regular expressions)
  18.  Selections     # summary of selections
  19.  Characters     # summary of MPW Shell special characters
  20.  Shortcuts      # summary of MPW Shell shortcuts
  21.  Variables      # summary of the standard MPW shell variables
  22.  Projector      # summary of Projector, a project/source control system
  23.  
  24.  Copyright Apple Computer, Inc. 1986-1990
  25.  All rights reserved.
  26.  
  27. æKY Commands
  28. æC              MPW Commands -- A list of MPW executable commands
  29.  
  30.  AddMenu         # add a menu item
  31.  AddPane         # split the window into panes
  32.  Adjust          # adjust lines
  33.  Alert           # display an alert box
  34.  Alias           # define or write command aliases
  35.  Align           # align text to left margin
  36.  Asm             # MC68xxx Macro Assembler
  37.  Backup          # folder file backup
  38.  Beep            # generate tones
  39.  Begin           # group commands
  40.  Break           # break from For or Loop
  41.  Browser         # invoke Marker Browser
  42.  BuildCommands   # show build commands
  43.  BuildMenu       # create the Build menu
  44.  BuildProgram    # build the specified program
  45.  C               # C compiler
  46.  Canon           # canonical spelling tool
  47.  Catenate        # concatenate files
  48.  CFront          # C++ to C translator
  49.  CheckIn         # check a file into a project
  50.  CheckOut        # check a file out from a project
  51.  CheckOutDir     # specify the directory where checked out files will placed
  52.  Choose          # choose or list network file server volumes and printers
  53.  Clear           # clear the selection
  54.  Close           # close specified windows
  55.  CMarker         # generate Mark commands for C and C++ function definitions
  56.  Commando        # present a dialog interface for commands
  57.  Compare         # compare text files
  58.  CompareFiles    # compare text files and interactively view differences
  59.  CompareRevisions# compare two revisions of a file in a project
  60.  Confirm         # display a confirmation dialog box
  61.  Continue        # continue with next iteration of For or Loop
  62.  Copy            # copy selection to Clipboard
  63.  Count           # count lines and characters
  64.  CPlus           # script to compile C++ source
  65.  CreateMake      # create a simple makefile
  66.  Cut             # copy selection to Clipboard and delete it
  67.  Date            # write the date and time
  68.  Delete          # delete files and directories
  69.  DeleteMenu      # delete user-defined menus and menu items
  70.  DeleteNames     # delete user-defined symbolic names
  71.  DeletePane      # delete panes from the window
  72.  DeleteRevisions # delete previous revisions of files in a project
  73.  DeRez           # resource decompiler
  74.  Directory       # set or write the default directory
  75.  DirectoryMenu   # create the Directory menu
  76.  DoIt            # highlight and execute a series of shell commands
  77.  DumpCode        # write formatted CODE resources
  78.  DumpFile        # display contents of any file
  79.  DumpObj         # write formatted object file
  80.  Duplicate       # duplicate files and directories
  81.  Echo            # echo parameters
  82.  Eject           # eject volumes
  83.  Entab           # convert runs of spaces to tabs
  84.  Equal           # compare files and directories
  85.  Erase           # initialize volumes
  86.  Evaluate        # evaluate an expression
  87.  Execute         # execute command file in the current scope
  88.  Exists          # confirm the existence of a file or directory
  89.  Exit            # exit from a command file
  90.  Export          # make variables available to commands
  91.  FileDiv         # divide a file into several smaller files
  92.  Files           # list files and directories
  93.  Find            # find and select a text pattern
  94.  Flush           # flush the tools that the Shell has cached
  95.  For             # repeat commands once per parameter
  96.  Format          # set or display formatting options for a window
  97.  Get             # get information about a key word from a data file
  98.  GetErrorText    # display error messages based on message number
  99.  GetFileName     # display a Standard File dialog box
  100.  GetListItem     # display items for selection in a dialog box
  101.  Help.MPW        # write summary information
  102.  If              # conditional command execution
  103.  Lib             # combine object files into a library file
  104.  Line            # find line in the target window
  105.  Link            # link an application, tool, or resource
  106.  Loop            # repeat commands until Break
  107.  Make            # build up-to-date version of a program
  108.  MakeErrorFile   # create error message textfile
  109.  Mark            # assign a marker to a selection
  110.  Markers         # list markers
  111.  MatchIt         # semi-intelligent language sensitive bracket matcher
  112.  MergeBranch     # merge a branch revision onto the trunk
  113.  ModifyReadOnly  # enables a read-only Projector file to be edited
  114.  Mount           # mount volumes
  115.  MountProject    # mount projects
  116.  Move            # move files and directories
  117.  MoveWindow      # move window to h,v location
  118.  NameRevisions   # define a symbolic name
  119.  New             # open a new window
  120.  Newer           # compare modification dates of files
  121.  NewFolder       # create a new folder
  122.  NewProject      # create a new project
  123.  Open            # open file(s) in window(s)
  124.  OrphanFiles     # remove Projector information from a list of files
  125.  Parameters      # write parameters
  126.  Pascal          # Pascal compiler
  127.  PasMat          # Pascal programs formatter
  128.  PasRef          # Pascal cross-referencer
  129.  Paste           # replace selection with Clipboard contents
  130.  PerformReport   # generate a performance report
  131.  Position        # display current line position
  132.  Print           # print text files
  133.  PrintProff      # analyze a .proff file and print the results
  134.  ProcNames       # display Pascal procedure and function names
  135.  Project         # set or write the current project
  136.  ProjectInfo     # display information about a Project
  137.  Quit            # quit MPW
  138.  Quote           # echo parameters, quoting if needed
  139.  Rename          # rename files and directories
  140.  Replace         # replace the selection
  141.  Request         # request text from a dialog box
  142.  ResEqual        # compares the resources in two files
  143.  Revert          # revert window to previous saved state
  144.  Rez             # resource compiler
  145.  RezDet          # detect inconsistencies in resources
  146.  RotateWindows   # send active (frontmost) window to back
  147.  Save            # save specified windows
  148.  SaveOnClose     # set save behavior when closing windows
  149.  Search          # search files for pattern
  150.  Set             # define or write Shell variables
  151.  SetDirectory    # set the default directory
  152.  SetFile         # set file attributes
  153.  SetPrivilege    # set access privileges for directories on file servers
  154.  SetVersion      # maintain version and revision number
  155.  Shift           # renumber command file positional parameters
  156.  ShowSelection   # place the selection within an editor window
  157.  Shutdown        # power down or restart the machine
  158.  SizeWindow      # set a window's size
  159.  Sort            # sort or merge lines of text
  160.  StackWindows    # arrange windows diagonally
  161.  StreamEdit      # scriptable text editor
  162.  Target          # make a window the target window
  163.  TileWindows     # arrange windows in a tiled fashion
  164.  TransferCkid    # move Projector information from one file to another
  165.  Translate       # translate characters
  166.  Unalias         # remove aliases
  167.  Undo            # undo the last edit
  168.  Unexport        # remove variable definitions from the export list
  169.  Unmark          # remove a marker from a window
  170.  Unmount         # unmount volumes
  171.  UnmountProject  # unmount projects
  172.  Unset           # remove Shell variable definitions
  173.  UserVariables   # uses Commando to set all the user variables
  174.  Version         # print the version of the MPW Shell
  175.  VersionList     # print version info from files
  176.  Volumes         # list mounted volumes
  177.  WhereIs         # find the location of a file
  178.  Which           # determine which file the shell will execute
  179.  Windows         # list windows
  180.  ZoomWindow      # enlarge or reduce a window's size
  181.  
  182. æKY Help
  183. MPWHelp
  184.  
  185. æKL About411
  186. Characters
  187. Commands
  188. Expressions
  189. Patterns
  190. Projector
  191. Selections
  192. Shortcuts
  193. Variables
  194.  
  195. AddMenu
  196. AddPane
  197. Adjust
  198. Alert
  199. Alias
  200. Align
  201. Asm
  202. Backup
  203. Beep
  204. Begin
  205. Break
  206. BuildCommands
  207. BuildMenu
  208. BuildProgram
  209. C
  210. Canon
  211. Catenate
  212. CFront
  213. CheckIn
  214. CheckOut
  215. CheckOutDir
  216. Choose
  217. Clear
  218. Close
  219. CMarker
  220. Commando
  221. Compare
  222. CompareFiles
  223. CompareRevisions
  224. Confirm
  225. Continue
  226. Copy
  227. Count
  228. CPlus
  229. CreateMake
  230. Cut
  231. Date
  232. Delete
  233. DeleteMenu
  234. DeleteNames
  235. DeletePane
  236. DeleteRevisions
  237. DeRez
  238. Directory
  239. DirectoryMenu
  240. DoIt
  241. DumpCode
  242. DumpFile
  243. DumpObj
  244. Duplicate
  245. Echo
  246. Eject
  247. Entab
  248. Equal
  249. Erase
  250. Evaluate
  251. Execute
  252. Exists
  253. Exit
  254. Export
  255. FileDiv
  256. Files
  257. Find
  258. Flush
  259. For
  260. Format
  261. Get
  262. GetErrorText
  263. GetFileName
  264. GetListItem
  265. Help.MPW
  266. If
  267. Lib
  268. Line
  269. Link
  270. Loop
  271. Make
  272. MakeErrorFile
  273. Mark
  274. Markers
  275. MatchIt
  276. MergeBranch
  277. ModifyReadOnly
  278. Mount
  279. MountProject
  280. Move
  281. MoveWindow
  282. NameRevisions
  283. New
  284. Newer
  285. NewFolder
  286. NewProject
  287. Open
  288. OrphanFiles
  289. Parameters
  290. Pascal
  291. PasMat
  292. PasRef
  293. Paste
  294. PerformReport
  295. Position
  296. Print
  297. ProcNames
  298. Project
  299. ProjectInfo
  300. Quit
  301. Quote
  302. Rename
  303. Replace
  304. Request
  305. ResEqual
  306. Revert
  307. Rez
  308. RezDet
  309. RotateWindows
  310. Save
  311. SaveOnClose
  312. Search
  313. Set
  314. SetDirectory
  315. SetFile
  316. SetPrivilege
  317. SetVersion
  318. Shift
  319. ShowSelection
  320. Shutdown
  321. SizeWindow
  322. Sort
  323. StackWindows
  324. StreamEdit
  325. Target
  326. TileWindows
  327. TransferCkid
  328. Translate
  329. Unalias
  330. Undo
  331. Unexport
  332. Unmark
  333. Unmount
  334. UnmountProject
  335. Unset
  336. UserVariables
  337. Version
  338. VersionList
  339. Volumes
  340. WhereIs
  341. Which
  342. Windows
  343. ZoomWindow
  344. æKY Variables
  345. æC                  Variables defined by the MPW Shell:
  346.  
  347.  {Active}          full pathname of current active window
  348.  {Aliases}         list of all defined aliases
  349.  {Boot}            volume name of the boot disk
  350.  {Command}         full pathname of the last command executed
  351.  {MPW}             full pathname of the Macintosh Programmer's Workshop.
  352.  {ShellDirectory}  full pathname of the directory that contains the MPW Shell
  353.  {Status}          result of the last command executed (0 means successful)
  354.  {SystemFolder}    full pathname of the system folder
  355.  {Target}          full pathname of the target window
  356.  {User}            the current user name (initialized to the "Chooser" name)
  357.  {Windows}         list of current windows     
  358.  {Worksheet}       full pathname of the Worksheet window
  359.  
  360.  Variables used by the MPW Shell:
  361.  
  362.  {Commando}        name of the commando tool
  363.  {Commands}        list of directories to search for commands
  364.  {DirectoryPath}   list of common directories to speed changing directories
  365.  {Echo}            control the echoing of commands to diagnostic output
  366.  {Exit}            control script termination based on {Status}
  367.  {IgnoreCmdPeriod} control use of cmd-. during critical sections
  368.  {HideHelpKey}     deactivate "help" key on extended keyboard
  369.  {Test}            control execution of tools and applications
  370.  {AutoIndent}      auto indent setting used for new windows
  371.  {CaseSensitive}   control case sensitivity for searching
  372.  {Font}            font used for new windows
  373.  {FontSize}        font size used for new windows
  374.  {NewWindowRect}   window rectangle used for new windows (top,left,bottom,right)
  375.  {PrintOptions}    options used by the print menu commands
  376.  {SearchBackward}  control direction of searching
  377.  {SearchType}      control type of searching (literal/word/expression)
  378.  {SearchWrap}      control wrap-around search
  379.  {StackOptions}    options used by the Stack Windows menu command
  380.  {Tab}             tab size used for new windows
  381.  {TileOptions}     options used by the Tile Windows menu command
  382.  {WordSet}         set of characters that constitue a word
  383.  {ZoomWindowRect}  window rectangle used for a zoomed window (top,left,bottom,right)
  384.  
  385.  Variables automatically set before script execution:
  386.  
  387.  {0}               name of the currently executing script
  388.  {1}, {2}, … {n}   first, second, and nth parameter to the script
  389.  {#}               number of parameters
  390.  {Parameters}      equivalent to {1} {2} … {n}
  391.  {"Parameters"}    equivalent to "{1}" "{2}" … "{n}"
  392.  
  393.  Variables used for libraries and include files:
  394.  
  395.  {AIncludes}       directories to search for assemby-language include files        
  396.  {CIncludes}       directories to search for C include files
  397.  {CLibraries}      directory containing C library files
  398.  {Libraries}       directory containing shared library files
  399.  {PInterfaces}     directory containing Pascal interface files
  400.  {PLibraries}      directory containing Pascal library files
  401.  {RIncludes}       directory containing Rez include files
  402.  
  403. æKY Characters
  404. æC   The characters listed below have special meanings in the command language.
  405.  
  406.  
  407.  Space           Space separates words.
  408.  Tab             Tab also separates words.
  409.  
  410.  Return          Return separates commands.
  411.  ;               Semicolon also separates commands.
  412.  |               Pipe separates commands and pipes output to input.
  413.  &&              And separates commands, executing second if first succeeds.
  414.  ||              Or separates commands, executing second if first fails.
  415.  (…)             Parenthesis group commands.
  416.                  Parenthesis also group characters in filename patterns.
  417.  
  418.  #               Comment begins comments.
  419.  
  420.  ∂               Escape (Option-D) quotes the following character.
  421.  '…'             Single quote quotes all other characters.
  422.  "…"             Double quote quotes all characters except ∂, {, and `.
  423.  /…/             Slash quotes all characters except ∂, {, and `.
  424.  \…\             Backslash quotes all characters except ∂, {, and `.
  425.  
  426.  {…}             Braces denote variable substitution.
  427.  `…`             Backquotes denote command substitution.
  428.  
  429.  ?               Question mark matches any character in filename patterns.
  430.  ≈               Approximately (Option-X) matches any string in patterns.
  431.  […]             Brackets enclose character sets in filename patterns.
  432.  *               Star indicates zero or more repetitions in patterns.
  433.  +               Plus indicates one or more repetitions in patterns.
  434.  «…»             European quotes (Option-\ and Option-Shift-\) enclose
  435.                  repeat counts.
  436.  
  437.  <               Less-than indicates an input file specification.
  438.  >               Greater-than indicates an output file specification.
  439.  >>              Indicates appending to an output file specification.
  440.  ≥               Greater-than-or-equal indicates a diagnostic specification.
  441.  ≥≥              Indicates appending to a diagnostic file specification.
  442.  ∑               Capital sigma (option-w) indicates both an output file and
  443.                  diagnostic output file specification.
  444.  ∑∑              Indicates appending to the output and diagnostic file
  445.                  specification.
  446.  
  447.  …               Elipsis (Option-;) signals the Shell to use Commando
  448.  
  449. æKY Expressions
  450. æC  Expressions
  451.  
  452.  Numbers may be expressed in decimal, hexadecimal, octal, or
  453.  binary.  Any of the following formats may be used:
  454.  
  455.  [0-9]+          decimal number
  456.  0x[0-9a-f]+     hexadecimal number
  457.  $[0-9a-f]+      hexadecimal number
  458.  0[0-7]+         octal number
  459.  0b[01]+         binary number
  460.  
  461.  The operators listed below are used in expressions in the
  462.  Evaluate, If, Else If, Break, Continue, and Exit commands. 
  463.  
  464.  Alternate spellings of several operators are provided.
  465.  All of the operators are evaluated from left to right.
  466.  Operators with the highest precedence are listed first,
  467.  and operators in the same group have equal precedence.
  468.  
  469.  
  470.  (…)             expression grouping
  471.  
  472.  -               unary negation
  473.  ~               bitwise negation
  474.  !    NOT  ¬     logical NOT (¬ is Option-L)
  475.  
  476.  *               multiplication
  477.  ÷    DIV        division (÷ is Option-/)
  478.  %    MOD        modulus division
  479.  
  480.  +               addition
  481.  -               subtraction
  482.  
  483.  <<              shift left
  484.  >>              shift right
  485.  
  486.  <               less than
  487.  <=   ≤          less than or equal to (≤ is Option-<)
  488.  >               greater than
  489.  >=   ≥          greater than or equal to (≥ is Option->)
  490.  
  491.  ==              equal
  492.  !=   <>   ≠     not equal (≠ is Option-=)
  493.  =~              equal to a pattern
  494.  !~              not equal to a pattern
  495.  
  496.  &               bitwise AND
  497.  
  498.  ^               bitwise XOR
  499.  
  500.  |               bitwise OR
  501.  
  502.  &&   AND        logical AND
  503.  
  504.  ||   OR         logical OR
  505.  
  506. æKY Selections
  507. æC      Selections - selections specify a selection or insertion point
  508.  
  509.  §                    current selection (Option-6)
  510.  n                    line number n
  511.  !n                   line n lines after end of current selection
  512.  ¡n                   line n lines before start of selection (Option-1)
  513.  position             position (defined below)
  514.  markerName           selection marked by markerName
  515.  pattern              pattern  (defined below)
  516.  (selection)          selection grouping
  517.  selection:selection  both selections and everything in between
  518.  
  519. position - positions specify an insertion point
  520.  
  521.  •                    position before first character of file (Option-8)
  522.  ∞                    position after last character of file (Option-5)
  523.  Δselection           position before first character of selection (Option-J)
  524.  selectionΔ           position after last character of selection (Option-J)
  525.  selection!n          position n characters after selection
  526.  selection¡n          position n characters before selection (Option-!)
  527.  
  528. pattern - patterns specify characters to be matched
  529.  
  530.  /entireRE/           regular expression - search forward
  531.  \entireRE\           regular expression - search backward
  532.  
  533.  Help Patterns           # See "Help Patterns" for more information.
  534.  
  535. æKY Patterns
  536. æC  Patterns - Patterns specify characters to be matched
  537.  /entireRE/           regular expression - search forward
  538.  \entireRE\           regular expression - search backward
  539.  
  540. entireRE
  541.  
  542.  •RE                  regular expression at beginning of line (Option-8)
  543.  RE∞                  regular expression at end of line (Option-5)
  544.  RE                   regular expression
  545.  
  546. RE
  547.  
  548.  simpleExpr           simple regular expression - defined below
  549.  (RE)®digit           tagged RE - refer to match as ®digit (Option-R)
  550.  'string'             literal - no characters within '…' are special
  551.  "string"             literal - only ∂, {, and ` are special within "…"
  552.  RE1RE2               regular expression RE1 followed by RE2
  553.  
  554. simpleExpr
  555.  
  556.  (RE)                 regular expression grouping
  557.  charExpr             single character regular expression - defined below
  558.  simpleExpr*          simple expression zero or more times
  559.  simpleExpr+          simple expression one of more times
  560.  simpleExpr«n»        simple expression n times (Option-\, Option-Shift-\)
  561.  simpleExpr«n,»       simple expression at least n times
  562.  simpleExpr«n1,n2»    simple expression at least n1, at most n2 times
  563.  
  564. charExpr
  565.  
  566.  character            character (unless it has special meaning)
  567.  ∂character           character - defeats any special meaning (Option-D)
  568.  ?                    any character except Return
  569.  ≈                    zero or more characters, except Return (Option-X)
  570.  [charList]           any character in the list
  571.  [¬charList]          any character not in the list (Option-L)
  572.  
  573. charList
  574.  
  575.  [                    [ first in the list represents itself
  576.  ]                    ] first in the list represents itself
  577.  -                    - first in the list represents itself
  578.  character            character
  579.  charList character   list of characters
  580.  character-character  character range (e.g. A-Z)
  581.  
  582. æKY ShortCuts
  583. æC   The following is a list of MPW Shell shortcuts:
  584.  
  585.     Double click        select word
  586.     Triple click        select line
  587.     Double Clicking on any of the characters (,),[,],{,},',",/,\,` will select
  588.     everything between the character and its mate.
  589.  
  590.     UpArrow             move insertion point one line above current position
  591.     DownArrow           move insertion point one line below current position
  592.     RightArrow          move insertion point one character to the right
  593.     LeftArrow           move insertion point one character to the left
  594.  
  595.  
  596.     Opt-LeftArrow       move insertion point one word to the left
  597.     Opt-RightArrow      move insertion point one word to the right
  598.     Cmd-UpArrow         move insertion point up one screen size
  599.     Cmd-DownArrow       move insertion point down one screen size
  600.     Cmd-RightArrow      move insertion point to end of current line
  601.     Cmd-LeftArrow       move insertion point to beginning of current line
  602.     Cmd-Opt-UpArrow     move insertion point to beginning of file
  603.     Cmd-Opt-DownArrow   move insertion point to end of file
  604.  
  605.     For the above eight shortcuts, use of the Shift key changes the action
  606.     from "move" to "extend selection."  E.g., Cmd-Shift-Opt RightArrow means
  607.     "extend selection to end of line."
  608.  
  609.     Delete              delete character to the left
  610.     Clear               delete character to the right
  611.     Opt-Delete          delete word to the left
  612.     Opt-Clear           delete word to the right
  613.     Cmd-Delete          delete from current position to end of line
  614.     Cmd-Clear           delete from current position to beginning of line
  615.     Cmd-Opt-Delete      delete from current position to end of file
  616.     Cmd-OptClear        delete from current position to beginnning of file
  617.  
  618.     Searching shortcuts
  619.         Cmd-Shift-G     reverse the direction of "Find Same"
  620.         Cmd-Shift-H     reverse the direction of "Find Selection"
  621.         Cmd-Shift-T     reverse the direction of "Replace Same"
  622.         Holding down Shift while selecting OK will reverse the direction
  623.             of "Find" and "Find and Replace"
  624.  
  625.     Holding down Option while selecting "Tile Windows" or "Stack Windows"
  626.         will include the worksheet in the tiling or stacking
  627.     Holding down Option while pressing Return will disable auto-indent
  628.         for that line.
  629.     Holding down Option while pressing Enter will invoke Commando on that
  630.         command line.
  631.  
  632.     In Dialogs without an EditText item
  633.         Y              Yes
  634.         N              No
  635.         CMD .          Cancel
  636.         ESC            Cancel
  637.  
  638. æKY Profiling
  639. æC   Proff and PrintProff are a pair of components that provide profiling and
  640. performance monitoring for programs compiled from MPW C, C++, Pascal, and
  641. Object Pascal.  Profiling, which occurs while your program executes, is
  642. the dynamic recording for every routine call, of the identity of the called
  643. routine and the point from which it was called, e.g., statement n in procedure
  644. foo. Performance monitoring in the context of profiling is the recording of
  645. the time spent in each such routine.
  646.  
  647. The Proff component is actually a library:
  648.  
  649.      {MPW}Libraries:Libraries:Proff.o
  650.  
  651. The PrintProff component is a tool, to be found in {MPW}Tools:.  PrintProff
  652. produces a human-readable output from the data file generated by Proff.o.  In 
  653. order to obtain profiling data, compile and link as follows:
  654.  
  655. For C, C++, and Object Pascal, compile with the option "-sym full". Then, for
  656. C and C++, either apply the option "-trace on", or bracket the code to
  657. be monitored with "#pragma trace on" and "#pragma trace off".  For Object Pascal,
  658. bracket the code to be monitored with "{$D++}" and "{$D--}".  Link with the 
  659. following command line:
  660.  
  661.      Link -sn ProffSeg=main -sym full …
  662.  
  663. In order to monitor code that executes when A5 does not belong to the target
  664. program, e.g. ROM patch code, do C (or C++) compilations with the option "-b3"
  665. to force PC-relative branches and jumps.  In Object Pascal, this is the default.
  666. Link with the following:
  667.  
  668.      Link -sn ProffSet=<residentSeg> -sym full …
  669.  
  670. The file containing the profiling data will have the target (application) name
  671. with .Proff appended as a suffix.  Important: When profiling an MPW tool, the
  672. generated name will be "MPW Shell.Proff".  This should be changed manually
  673. to "<toolname>.Proff" before running PrintProff.
  674.  
  675.                              See also 
  676.  
  677. PrintProff
  678.  
  679. æKY Projector
  680. æC   Projector is a collection of built–in MPW commands and windows that
  681.  help programmers (both individuals and teams) control and account for
  682.  changes to all the files (documentation, source, applications etc.)
  683.  associated with a software project.
  684.  
  685.  Here is a brief summary of the commands (the CheckIn, CheckOut, and
  686.  NewProject commands also have windows that can be opened using the
  687.  "-w" option to the respective command):
  688.  
  689.  CheckIn          # check a file into a project
  690.  CheckOut         # check a file out from a project
  691.  CheckOutDir      # specify the directory where checked out files will placed
  692.  CompareRevisions # compare two revisions of a file in a project
  693.  DeleteNames      # delete user-defined symbolic names
  694.  DeleteRevisions  # delete previous revisions of files in a project
  695.  MergeBranch      # merge a branch revision onto the trunk
  696.  ModifyReadOnly   # enables a read-only Projector file to be edited
  697.  MountProject     # mount projects
  698.  NameRevisions    # define a symbolic name
  699.  NewProject       # create a new project
  700.  OrphanFiles      # remove Projector information from a list of files
  701.  Project          # set or write the current project
  702.  ProjectInfo      # display information about a Project
  703.  TransferCkid     # move Projector information from one file to another
  704.  UnmountProject   # unmount projects
  705.  
  706.                              Examples
  707.  
  708.   The command
  709.  
  710.   Project
  711.  
  712.   causes the current project name to be written to standard output.
  713.   To change the current project to OurProject, use
  714.  
  715.   Project OurProject
  716.  
  717.  
  718.                              See also 
  719.  
  720.   NewProject, MountProject.
  721.  
  722.  
  723. æKY About411
  724. æC         
  725. About "411"
  726. "411" provides a way for Macintosh developers to achieve rapid retrieval of software 
  727. development information while using Apple's MPW development system. The access can be 
  728. via menus and command keys or from command line entries.  The software development 
  729. information includes language-specific Inside Macintosh documentation, Tech Notes, 
  730. MPW command descriptions and Resource information.  In addition a facility for automatic 
  731. insertion of Toolbox call templates is provided.
  732.  
  733. "411" can also be customized and extended and new information can be added.  The help 
  734. files of "411" may be either local or on a shared file server.
  735.  
  736. Setting up "411"
  737.  
  738. "411" consists of a installation instructions file (Read Me First), a special UserStartup 
  739. script (UserStartup•Help), an installation script (Install411), and a set of help files 
  740. along with their .index and .wIndex files. It makes use of a new MPW tool, Get, which was  
  741. written to support "411" but can be used independently.  The "411" folder holds the help files,
  742. their index and cross reference index files and a "Tools" folder.  
  743.  
  744. An important decision to make in setting up "411" is whether to place the "411" Help files 
  745. on a server or on your local hard disk.  Since these files are large (over 16 Meg total) some 
  746. thought should go into deciding which files to use and whether to transfer them to your 
  747. hard disk or, if you are connected to a network, to a file server.  The most obvious candidate
  748. for removal is either CIncludesHelp or PInterfacesHelp.  If you are not developing in 
  749. both C and Pascal, one of them will probably not be needed. Less obvious, but more significant
  750. canidates for removal are the .wIndex files.  These files are not required but significantly 
  751. speeds up the cross reference search done when selecting the 'Search' menu item.  Placing the
  752. help files on a local hard disk will provide better access speed but will use significant disk
  753. space.  If you have access to a file server and several persons want to access "411" Help, it
  754. may be best to move the "411" folder to the file server.
  755.  
  756. Set up "411" by writing the following two commands to your MPW WorkSheet and 
  757. executing them:
  758.  
  759. <rls>:Install411 <info>
  760. Execute "{ShellDirectory}"UserStartup•Help
  761.  
  762. where <rls> denotes the path to the "411" files on the release medium and <info> denotes 
  763. the volume on which the user wishes the "411" Help files to reside.  If <info> is omitted, 
  764. the installation will be to the volume that begins the path <rls>.  (In this latter case, the 
  765. data files are not duplicated because they are already residing in the desired place.)
  766. For example, if "411" were to be released in a folder named 411Stuff on a CD named MPW 
  767. 3.2 Release, and the user wanted "411" to be installed on a volume named HelpMe, then 
  768. the commands to be executed would read:
  769.  
  770. 'MPW 3.2 Release:411Stuff:Install411' HelpMe:
  771. Execute "{ShellDirectory}"UserStartup•Help
  772.  
  773. The effect of the first of the above commands is to create the folder HelpMe:411: and to 
  774. copy to it all of the "411" files.  It then, additionally, copies the new Get tool to the 
  775. user’s MPW Tools folder, copies UserStartup•Help to the MPW folder, and creates a folder 
  776. called Help Folder in the MPW folder.  This latter folder contains at this time a file called 
  777. Help_Folder whose contents is the single line: HelpMe:411:, i.e. the name of the folder 
  778. containing the "411" information.  The effect of the second of the above commands is to 
  779. add the "411" menu to the menu bar, and to add one more file to the Help Folder,  a file 
  780. called Help_Files which  contains the names of all of the "411" data files in the order in 
  781. which they will be interrogated, e.g.:
  782.  
  783. HelpMe:411:CIncludesHelp
  784. HelpMe:411:InsideMacintoshHelp
  785. HelpMe:411:MPWHelp
  786. HelpMe:411:PInterfacesHelp
  787. HelpMe:411:ResourcesHelp
  788. HelpMe:411:TechNotesHelp
  789.  
  790. NOTE:  Because the cross reference (.wIndex) files are so large they are not installed
  791. automatically.  If you want to use these files just drag their icon to the desired folder.
  792.  
  793. Using the "411" Help menu
  794.  
  795. "411" works only from within the MPW development environment.  When "411" is properly 
  796. set up, there should be a 411 menu on the MPW menu bar.  If there has been no 
  797. change to the UserStartup•Help script, the Help menu looks like this:
  798.  
  799.  
  800.  411 Menu
  801.     
  802.         Directory  Build  411                   
  803.        ________________________________________________
  804.           HD:MPW:Worksheet       |  Contents          |
  805.        __________________________|  Look up    CMD-E  |
  806.                                  |  Template   CMD-1  |
  807.                                  |  Show Keys         |
  808.                                  |  Search            |
  809.                                  |____________________|
  810.                                  |  Set First File ...|
  811.                                  |  Set 411 Files ...|
  812.                                  |  Edit 411 Files ...|
  813.                                  |____________________|
  814.                                  |  About 411 ...     |
  815.                                  |____________________|
  816.  
  817. The menu items Look up and Template search all of the files listed in Help_Files; 
  818. the items Contents, Show Keys, and Search look only at the first file in the 
  819. Help_Files list.  This first file is known as the currently selected file.  It can be changed 
  820. by using the Set First File menu item.
  821.  
  822.  
  823. Contents
  824.  
  825. This menu item lets you see a list of the Help file’s table of contents.  For example, if the 
  826. CIncludesHelp file is the currently selected Help file, then selecting the "Contents" menu 
  827. item, causes a list of the ToolBox managers to appear in the Help window.
  828. ————————————————————————————————————————————————————————————————————————
  829. HelpMe:411:CIncludesHelp           Look up… "Help" 
  830. ————————————————————————————————————————————————————————————————————————
  831. Appletalk.h       FixMath.h         Palettes.h     Serial.h
  832. Controls.h        Fonts.h           Perf.h         ShutDown.h
  833. CursorCtl.h       Globals           Picker.h       Slots.h
  834. Desk.h            Graf3D.h          Printing.h     Sound.h
  835. Deskbus.h         HyperXCmd.h       Quickdraw.h    Start.h
  836. ...
  837.  
  838. Note that you can obtain the same information by selecting the key word "Help" (or the 
  839. name of the help file, e.g. CIncludesHelp) and then selecting the Look up menu item.  
  840.  
  841.  
  842. Look up  (Command-E)
  843.  
  844. This menu item lets you look up information stored in the help files; the search starts with 
  845. the currently selected file (See Set First File...).   For example, if you choose (see 2 
  846. below) the word FindWindow and then select the Look up menu item (or type Command-E) the 
  847. following information will appear in the Help window:
  848.  
  849. ------------------------------------------------------------------------
  850. HelpMe:411:CIncludesHelp     Look up… "findwindow" 
  851. ------------------------------------------------------------------------
  852. short findwindow(Point *thePoint,WindowPtr *theWindow);
  853. Type: Function
  854. File {CIncludes}Windows.h
  855. Trap Number A92C
  856. InsideMacintosh Reference: FindWindow function I-287, P-35, 114, 170 
  857. FindWindow procedure  V-208
  858. [Macintosh Plus, Macintosh SE, Macintosh II]
  859.  
  860. When a mouse-down event occurs, the application should call FindWindow 
  861. with thePt equal to the point where the mouse button was pressed (in 
  862. global coordinates, as
  863. ...
  864. Thus, to get help for a given key word:
  865.  
  866. 1) Choose the Help file you want information from by using the Set First File... menu 
  867. item to make the desired file the first file (currently selected file) in the help file list.  
  868. (Skip this step if the help file is already selected, or if the order of search does not 
  869. matter.)
  870.  
  871. 2) Click on a word in the active window.  You may want to type in the word you want to 
  872. look up instead.  If the item is just one word, it will be automatically selected if the 
  873. insertion point is adjacent to or within the word.  Only if a multiple word item is to be 
  874. looked up is it necessary to do a manual selection of the entire item.  (Note:  the means 
  875. you don’t have to double-click.  Also you don’t have to type the entire word, just 
  876. enough letters to allow 411 to distinguish between the word you want and any other in 
  877. the current Help file.)  
  878.  
  879. 3) Select the menu item Look up or type Command-E.  This triggers a search through the help 
  880. files, in the order in which they are listed,  looking for the selected key word.  If the 
  881. search is successful then a window named Help (a file in the MPW directory) is opened 
  882. and the information associated with the key word is displayed, along with an indication 
  883. of the file in which the key word was found.
  884.  
  885. Remember, the Look up menu item simply looks for the current selection in the active 
  886. window.
  887.  
  888. Since numbers are keywords only in TechNotesHelp, selecting a number will retrieve the 
  889. Macintosh Technical note of that number.
  890.  
  891. The header, which is placed above the "Contents" information, shows the help file that was 
  892. used.  To the right of the file name is a message indicating the key word on which the 
  893. search was made.  A mark is set to this (selected) key word in the file Help to aid the user 
  894. in subsequent scanning of Help for previously gathered information.  
  895.  
  896. A slight modification of UserStartup•Help causes the header to list all the "411" files in 
  897. the order in which they are searched, with  the words on the right (Look up…) printed on 
  898. the line bearing the name of the file in which the item was actually found.  (See 
  899. Customizing "411" below.)
  900.  
  901.  
  902. Template  (Command-1)
  903.  
  904. This menu item lets you replace a toolbox function call such as FindWindow with the 
  905. template for that function.  For example if you were to select "FindWindow" and choose 
  906. the 'Template' menu item (or type Command-1), then your "FindWindow" selection in the Active 
  907. window would be replaced by:
  908.  
  909. short myVariable = findwindow((Point *)thePoint,(WindowPtr *)theWindow);
  910.  
  911. Both C and Pascal templates are available.  Use Set First File... on the 411 menu to 
  912. choose a language by selecting either CIncludesHelp or PInterfacesHelp.
  913.  
  914.  
  915. Show keys…
  916.  
  917. This menu item lets you list all of the keys in the currently selected help file which begin 
  918. with the word you have selected in the Request dialog.  For example, selecting this menu 
  919. and then typing the two letters "fs" when CIncludesHelp is your current (first listed) help 
  920. file, produces a list of all of the HFS calls that begin with "FS", i.e. FSClose, ...
  921.  
  922.  
  923. Search…
  924.  
  925. This menu item lets you search the currently selected help file for all occurrences of the 
  926. word you have selected.  The result is a list of names (keys) whose data records contain the 
  927. word.  On a large Help file, e.g. CIncludesHelp, this can take a minute or more.  Only the 
  928. current  (first listed) help file is searched even if no data record containing the word is 
  929. found.  If your help folder contains a cross reference (.wIndex) file for the Help file the
  930. time to search a file is reduced to several seconds.
  931.  
  932.  
  933. Set First File…
  934.  
  935. This menu item lets you choose a help file to be the currently selected file.  A dialog window 
  936. shows a list of all help files, and you are invited to make a selection.   The selected file 
  937. then becomes the first file in the list that appears in the file Help_Files.  It is then known 
  938. as the currently selected file, and, until you again reorder the list, is the initial target 
  939. of all Look up, Template, and Contents requests, and the only file used by Show Keys and 
  940. Search.  The Help window opens, displaying the contents list of the selected file.  
  941.  
  942. Set 411 Files…
  943.  
  944. This menu item presents a standard file dialog from which to locate a help folder.  If a help 
  945. folder is selected then all the files in the folder that end in the word help are placed in 
  946. the list of files to search (in Help_Files).  Note that this will remove any existing files 
  947. from the list..
  948.  
  949.  
  950. Edit 411 Files
  951.  
  952. This menu item open the Help_Files window, which contains a list of all the help files 
  953. that "411" knows about.  The list may be edited and then saved.  Note that each line 
  954. specifies a path to a single help file.
  955.  
  956.  
  957. About 411…
  958.  
  959. This menu item displays the credits and then does a lookup in the MPWHelp file for the 
  960. key "About411".
  961.  
  962.  
  963. Customizing "411"
  964.  
  965. There are several ways in which "411" can be customized by modifying the 
  966. UserStartup•Help script:
  967.  
  968. •   If you are using a file server and want the script to call the MPW Choose tool to mount 
  969.     the file server when MPW is launched, set the script variables Help_Server and 
  970.     Guest. Set the former to the desired zone:server:volume pathname, and set the 
  971.     latter to 1 if want to log onto the server as an AppleShare "guest.".  Note: This requires 
  972.     the Choose tool from MPW 3.2 or later.
  973.  
  974. •   If you wish to add or change command keys in the menu, simply edit the AddMenu 
  975.     commands in the UserStartup•Help script. For example, the line
  976.  
  977.     AddMenu 411 "Look up/1" 
  978.  
  979.     in the script could be changed to:
  980.  
  981.     AddMenu 411 "Look up/7" 
  982.  
  983.     to change the function key to Command-7.  Alternatively,
  984.  
  985.     AddMenu 411 "Look up" 
  986.     removes the function key associated with the Look up menu item entirely.
  987.  
  988. •   If you wish to change the name of the "411" menu, modify the argument of the AddMenu 
  989.     command.  For example, you can change the menu name "411" to "MyMenu" by 
  990.     changing all occurrences of AddMenu 411... to AddMenu MyMenu... in the 
  991.     UserStartup•Help script.
  992.  
  993. •   If you wish all help files to be listed in the header, change the script so that it sets 
  994.     the value of the variable headerStyle to -h (the default is -h2).
  995.  
  996.  
  997. Using the Get Tool
  998.  
  999. The retrieval of information through the "411" Help menu is based upon calls to the MPW 
  1000. Get tool.  The calls that are used by "411" can be seen in the file UserStartup•Help.  If 
  1001. you choose, you may instead call the Get tool directly or from your own script.  
  1002.  
  1003. (See the section on Get in the MPW 3.2 B1 Tools/Scripts Release Notes.)  
  1004.  
  1005.  
  1006. Adding your own help to "411"
  1007.  
  1008. Help files used by the Get tool are ordinary MPW Shell document files whose names end 
  1009. with "Help" and that have an internal organization which is recognized by the Get tool.  
  1010. The requirements are that a Help file consists of a set of records, each record in turn 
  1011. consisting of one or more fields.  Each record must start with the field tag æKY ("æ" is 
  1012. option-')  followed by one or more words separated by carriage returns.  The search of the 
  1013. help file is made on the key words.  All other fields are various categories of information to
  1014. be retrieved.  Field tags must be the first item on a line, and are separated from the 
  1015. following material by one or more spaces.  Field tags are case sensitive.  Each field is 
  1016. terminated by the appearance of a new field tag.  The record is terminated by the next æKY tag
  1017. (or end of file).
  1018.  
  1019. Example:
  1020.  
  1021.  
  1022.  æKY Key1
  1023.      Key2
  1024.      Key3
  1025.  æC This is a comment
  1026.  
  1027. The various tags other than æKY are used to put the information to be retrieved into 
  1028. categories.  The most neutral of them is æC, which is used for general textual matter.  These 
  1029. tags in some cases modify the behavior of Get.  For example, the tag æDT, which is used 
  1030. for templates, precedes data which will be retrieved if and only if Get is called with the -t 
  1031. option.  This is used in the implementation of the "template" menu item.  Other tags cause 
  1032. some boiler plate to be emitted prior to the text in the data base.  For example, the tag æRI 
  1033. is used for fields that contain chapter and page references to Inside Macintosh.  The text 
  1034. following the field tag will have inserted before it the cosmetic text:  "InsideMacintosh 
  1035. Reference:".  
  1036.  
  1037. Field Tag Codes:
  1038.  
  1039.  æKY     Key word or set of key words separated by carriage returns.  This field denotes
  1040.          the beginning of  a "411" record and the words in this field are the record's
  1041.          names, i.e. the words used as keys for retrieval of the record’s data.
  1042.  
  1043.  æKL     Key word List .  This is typically used in conjunction with the key "Help" to
  1044.          list, as a table of contents, all of the key words in the file.
  1045.  
  1046.  æFa     File name of Assembler include file.
  1047.  
  1048.  æFc     File name of C header file.
  1049.  
  1050.  æFp     File name of Pascal Interface file.
  1051.  
  1052.  æF      Used for the names of files which are not interfaces.
  1053.  
  1054.  æT      Type of the item:  function/structure/constant/etc. 
  1055.  
  1056.  æD      Formal declaration of the item: function, procedure, or structure. 
  1057.  
  1058.  æDT     A template for calls of procedures and functions.
  1059.  
  1060.  æC      Commentary.  This is general textual information, generally lengthy compared
  1061.         to that associated with the other tags.
  1062.  
  1063.  æR      Reference to…  Used for references other than to Tech Notes and Inside
  1064.         Macintosh.
  1065.  
  1066.  æRI     Reference to Inside Macintosh.  This is usually a chapter and page reference.
  1067.  
  1068.  æRT     Reference to Tech Note.  This is usually a reference by number.
  1069.  
  1070.  æTN     Trap Number.  This is used to annotate function that are in-line trap calls.
  1071.  
  1072.  æMM     Routine may move or purge memory.  This tag cause issuance of the preceding
  1073.         warning.
  1074.  
  1075.  
  1076. When the Get tool is executed, it first retrieves the byte offset of a key word from the index 
  1077. file, positions to the æKY line in the help file, and then reads all of the following lines 
  1078. until another æKY typed line is encountered.  Get then outputs the record, after first 
  1079. removing the field tag codes from each field.  Therefore, if the contents of a help file are
  1080. altered in any way, it is necessary that the index be rebuilt.  This is handled automatically
  1081. by the Get tool, which puts up a dialog stating that the index needs to be rebuilt and
  1082. requesting permission.  In ordinary circumstances, this dialog should be answered 
  1083. affirmatively.
  1084.  
  1085.  
  1086. About the files in your "411" folder
  1087.  
  1088. The "411" folder contains the following files:
  1089. :411:
  1090.        Install411                   # the "411 installation script.
  1091.        CIncludesHelp                # the CIncludesHelp data file. 
  1092.        CIncludesHelp.index          # the CIncludesHelp index file. 
  1093.        CIncludesHelp.windex         # the CIncludesHelp cross reference index file. 
  1094.        InsideMacintoshHelp          # Vols. 1-6 data file.
  1095.        InsideMacintoshHelp.index    # Vols. 1-6 index file.
  1096.        InsideMacintoshHelp.windex   # Vols. 1-6 cross reference index file.
  1097.        MPWHelp                      # the MPWHelp data file.
  1098.        MPWHelp.index                # the MPWHelp index file.
  1099.        MPWHelp.windex               # the MPWHelp cross reference index file.
  1100.        PInterfacesHelp              # the PInterfacesHelp data file.
  1101.        PInterfacesHelp.index        # the PInterfacesHelp index file.
  1102.        PInterfacesHelp.windex       # the PInterfacesHelp cross reference file.
  1103.        ResourcesHelp                # the ResourcesHelp data file.
  1104.        ResourcesHelp.index          # the ResourcesHelp index file.
  1105.        ResourcesHelp.windex         # the ResourcesHelp cross reference index file.
  1106.        TechNotesHelp                # the TechNotesHelp data file.
  1107.        TechNotesHelp.index          # the TechNotesHelp index file.
  1108.        TechNotesHelp.windex         # the TechNotesHelp cross reference index file.
  1109.                           
  1110.  
  1111. :411:Tools:
  1112.        Get                          # the Get MPW tool - used to
  1113.                                     # look up help info.
  1114.        UserStartup•Help             # the "411" UserStartup script.
  1115.  
  1116.  
  1117. Files created by "411"
  1118.  
  1119. The following files are created by the UserStartup•Help script, either at startup time, or 
  1120. as the result of execution of menu items created by the script.  They all reside in the folder 
  1121. "{MPW}Help Folder:"
  1122.  
  1123.  
  1124.  
  1125.          Help                      # your "411" Help window.
  1126.          Help_Folder               # contains the "411" path name 
  1127.                                    # (path name to help data and 
  1128.                                    # index files) 
  1129.          Help_Files                # contains the list of all help  
  1130.                                    # files (full file names including path)
  1131.          Help_Temp                 # temporary file used by the "411" menu
  1132.  
  1133.  
  1134.  
  1135. æKY AddPane
  1136. æC                         AddPane-- split the window into panes
  1137.  
  1138. AddPane[-p paneSpec] [-h ySplit | -v xSplit] [window]
  1139.      -p paneSpec           # choose a pane to split
  1140.      -y ySplit             # horizontal split at ySplit pixels from top
  1141.      -x xSplit             # vertical split at xSplit pixels from left
  1142.  
  1143.       Note: paneSpec is an alternating catenation of strings of the 
  1144.       form cm and rn, where m is a column ordinal and n is a row ordinal.
  1145.  
  1146.  
  1147.  
  1148. æKY AddMenu
  1149. æC                      AddMenu -- add a menu item
  1150.  
  1151. AddMenu [menu [item [command…]]]  > menuList
  1152.  
  1153. Status codes returned:
  1154.   0    No errors.
  1155.   1    Syntax error.
  1156.   2    An item can’t be redefined.
  1157.   3    System error.
  1158.  
  1159.                            Description
  1160.  
  1161.   Associates a list of commands with the menu item itemName in the
  1162.   menu menuName. If the menu menuName already exists, the new item
  1163.   is appended to the bottom of that menu. If the menu menuName doesn’t
  1164.   already exist, a new menu is appended to the menu bar, and the new
  1165.   item is appended to that menu. When the new menu item is selected,
  1166.   its associated command list is executed just as though the command
  1167.   text had been selected and executed in the active window.
  1168.  
  1169.     • Note: The command text that you specify for an AddMenu item
  1170.     is processed twice—once when you execute the AddMenu command
  1171.     itself, and again whenever you subsequently select the new menu
  1172.     item. This means that you must be careful to quote items so that
  1173.     they are processed at the proper time. See the "Examples" section
  1174.     below.
  1175.  
  1176.   You can also use AddMenu to display information for existing user-defined
  1177.   menus by omitting parameters:
  1178.  
  1179.     • If command is not specified, the command list associated with
  1180.     itemName is written to standard output.
  1181.  
  1182.     • If itemName and command are both omitted, a list of all user-defined
  1183.     items for menuName is written to standard output.
  1184.  
  1185.     • If no parameters are specified, a list of all user-defined
  1186.     items is written to standard output.
  1187.  
  1188.   (This output is in the form of AddMenu commands.)
  1189.  
  1190.   You can also use AddMenu to change the command list or markings associated
  1191.   with a particular itemName. If both menuName and itemName already
  1192.   exist, the command list associated with itemName will be changed
  1193.   to command. Also, any marking or styles associated with itemName
  1194.   will be changed. The position of itemName in menuName will not be
  1195.   affected.
  1196.  
  1197.   You can define keyboard equivalents, character styles, and other
  1198.   features for your new menu commands—itemName can contain any of the
  1199.   metacharacters that are used with the AppendMenu( ) procedure documented
  1200.   in the MPW chapter entitled "Menu Manager" of Inside Macintosh:
  1201.  
  1202.   /char        Assign the keyboard equivalent Command-char.
  1203.  
  1204.   !char        Place char to the left of the menu item.
  1205.  
  1206.   ^n           Item has an icon, where n is the icon number. See Inside 
  1207.                Macintosh.
  1208.  
  1209.   (            Item is disabled (dimmed).
  1210.  
  1211.   <style       Item has a special character style; this style can be any
  1212.                of the following capital letters:
  1213.  
  1214.                B Bold
  1215.  
  1216.                I Italic
  1217.  
  1218.                U Underline
  1219.  
  1220.                O Outline
  1221.  
  1222.                S Shadow
  1223.  
  1224.   Multiple styles may be specified by preceding each with "<". Be sure
  1225.   to quote menu items containing these special characters. (See the
  1226.   "Examples" section below.)
  1227.  
  1228.     • Note: Semicolons ( ; ) cannot be used within an itemName.
  1229.  
  1230.   Menu items can’t be appended to the Window, Mark, or Apple menus.
  1231.  
  1232.  
  1233.                             Examples
  1234.  
  1235.   AddMenu
  1236.  
  1237.   Lists all user-defined menu items.
  1238.  
  1239.   AddMenu Extras "TimeStamp//P" 'Echo `Date`'
  1240.  
  1241.   Adds an "Extras" menu with a "TimeStamp" item, which writes the current
  1242.   time and date to the active window. This item has the Command-key
  1243.   equivalent Command-P.
  1244.  
  1245.   AddMenu File 'Format<B' 'Erase 1'
  1246.  
  1247.   Adds a "Format" item to the File menu (as discussed under the Erase
  1248.   command) and makes the item bold.
  1249.  
  1250.   AddMenu Find Top 'Find • "{Active}"'
  1251.  
  1252.   Adds the menu item "Top" to the Find menu, and defines it as the
  1253.   Find command enclosed in single quotation marks. This command places
  1254.   the insertion point at the beginning of the active window.
  1255.  
  1256.   Note: The following attempt to do the same thing will not work:
  1257.  
  1258.   AddMenu Find Top "Find • {Active}"
  1259.  
  1260.   This command won’t work because the {Active} variable will be expanded
  1261.   when the menu is added. (It should be expanded when the menu item
  1262.   is executed.) In the first (correct) example, the single quotes defeat
  1263.   variable expansion when the AddMenu command is executed; they are
  1264.   then stripped before the item is actually added. The double quotation
  1265.   marks remain, in case the pathname of the active window happens to
  1266.   contain any special characters.
  1267.  
  1268.   You may want to add some or all of the following commands to your
  1269.   UserStartup file:
  1270.  
  1271.   AddMenu Find '(-' ''
  1272.  
  1273.   AddMenu Find 'Top/6' 'Find • "{Active}"'
  1274.  
  1275.   AddMenu Find 'Bottom/5' 'Find ∞ "{Active}"'
  1276.  
  1277.   These commands create several new items in the Find menu. The first
  1278.   is a disabled separator that creates a new section at the bottom
  1279.   of the menu. The Top and Bottom items position the insertion point
  1280.   at the top and bottom of the active window. Both menu items have
  1281.   Command-key equivalents.
  1282.  
  1283.   AddMenu Directory 'Work' 'Directory HD:MPW:Work'
  1284.  
  1285.   AddMenu Directory 'Work!•' 'Directory HD:MPW:Work'
  1286.  
  1287.   The first command creates a command to move to the directory HD:MPW:Work.
  1288.   The second command marks the Work item with a bullet without changing
  1289.   the position of the item in the menu.
  1290.  
  1291.                             See also 
  1292.  
  1293.    DeleteMenu command.
  1294.  
  1295.   "Quoting Special Characters," "How Commands Are Interpreted," and
  1296.   "Defining Your Own Menu Commands" in Chapter 5.
  1297.  
  1298.   "Creating a Menu in Your Program" in chapter "Menu Manager" of Inside
  1299.   Macintosh.
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305. æKY Adjust
  1306. æC                        Adjust -- adjust lines
  1307.  
  1308. Adjust [-c count] [-l spaces] selection [window]
  1309.  
  1310.  -c count                # repeat the Adjust count times
  1311.  -l spaces               # shift lines by "spaces" spaces
  1312.  
  1313. Status codes returned:
  1314.   0    At least one instance of the selection was found.
  1315.   1    Syntax error.
  1316.   2    Another error.
  1317.  
  1318.                            Description
  1319.  
  1320.   Finds and selects the given selection and shifts all lines within
  1321.   the selection to the right by one tab, without changing the indentation.
  1322.  
  1323.   If a count is specified, count instances of selection are affected.
  1324.   The -l option lets you move lines by any number of spaces to the
  1325.   left or right.
  1326.  
  1327.   If you specify the window parameter, the command operates on window.
  1328.   It’s an error to specify a window that doesn’t exist. If no window
  1329.   is specified, the command operates on the target window (the second
  1330.   window from the front).
  1331.  
  1332.  
  1333.                             Examples
  1334.  
  1335.   Adjust -l 4 §
  1336.  
  1337.   Shifts the lines containing the target selection to the right by
  1338.   four spaces.
  1339.  
  1340.   Adjust -l -8 /if/Δ:Δ/else/
  1341.  
  1342.   Selects everything after the next "if" and before the following "else",
  1343.   and shifts all lines within the selection to the left by eight spaces.
  1344.  
  1345.                             See also 
  1346.  
  1347.   Align command.
  1348.   "Selections" in Chapter 6.
  1349.  
  1350. æKY Alert
  1351. æC                     Alert -- display an alert box
  1352.  
  1353. Alert [-s] [message…] < file
  1354.  -s                      # silent, don't beep when dialog is displayed
  1355.  
  1356. Status codes returned:
  1357.   0    No errors.
  1358.   1    Syntax error.
  1359.  
  1360.                            Description
  1361.  
  1362.   Displays an alert box containing the prompt message. The alert is
  1363.   displayed until its OK button is clicked. If the message contains
  1364.   any special characters, you’ll need to quote it.
  1365.  
  1366.  
  1367.                             Examples
  1368.  
  1369.   Alert Please insert next disk to be searched.
  1370.  
  1371.   Displays the following alert box and waits for the user to click
  1372.   "OK" before returning.
  1373.  
  1374.                             Also see
  1375.  
  1376.  Confirm and Request commands.
  1377. æKY Alias
  1378. æC               Alias  -- define or write command aliases
  1379.  
  1380. Alias [name [word…]]  > aliasList
  1381.  
  1382. Status codes returned:
  1383.   0    No errors.
  1384.   1    The specified alias could not be found.
  1385.  
  1386.                            Description
  1387.  
  1388.   Name becomes an alias for the list of words. Subsequently, when name
  1389.   is used as a command name, word… will be substituted in its place.
  1390.  
  1391.   If only name is specified, any alias definition associated with name
  1392.   is written to standard output. If name and word are both omitted,
  1393.   a list of all aliases and their values is written to standard output.
  1394.   (This output is in the form of Alias commands.)
  1395.  
  1396.   Aliases are local to the script in which they are defined. An initial
  1397.   list of aliases is inherited from the enclosing script. Inherited
  1398.   aliases may be overridden locally. You can make an alias definition
  1399.   available to all scripts by placing the definition in the UserStartup
  1400.   file.
  1401.  
  1402.   You can remove aliases with the Unalias command.
  1403.  
  1404.  
  1405.                              Examples
  1406.  
  1407.   Alias Dir Directory
  1408.  
  1409.   Creates an alias "Dir" for the Directory command.
  1410.  
  1411.   Alias Top 'Find •'
  1412.  
  1413.   Creates an alias "Top" for the command "Find •" (which places the
  1414.   insertion point at the beginning of a window). The command takes
  1415.   an optional window parameter and by default acts on the target window.
  1416.   The Top command could now be used as follows:
  1417.  
  1418.   Top # find top of target window
  1419.  
  1420.   Top Sample.a # find top of window Sample.a
  1421.  
  1422.   # (equivalent to "Find • Sample.a")
  1423.  
  1424.                             See also
  1425.  
  1426.   Unalias command.
  1427.   "Command Aliases" in Chapter 5.
  1428.  
  1429. æKY Align
  1430. æC                 Align -- align text to left margin
  1431.  
  1432. Align [-c count] selection [window]
  1433.  -c count                # repeat the Align count times
  1434.  
  1435. Status codes returned:
  1436.   0    At least one instance of the selection was found.
  1437.   1    Syntax error.
  1438.   2    Any other error.
  1439.  
  1440.                            Description
  1441.  
  1442.   All lines within each instance of the selection are positioned to
  1443.   the same distance from the left margin as the first line in the selection.
  1444.  
  1445.   If you specify the window parameter, the Align command will act on
  1446.   window. It’s an error to specify a window that doesn’t exist. If
  1447.   no window is specified, the command operates on the target window
  1448.   (the second window from the front).
  1449.  
  1450.  
  1451.                              Examples
  1452.  
  1453.   Align §
  1454.  
  1455.   Same as the Align menu item; that is, it aligns all lines in the
  1456.   default selection with the first line of the selection.
  1457.  
  1458.   Align /Begin/:/End/
  1459.  
  1460.   Selects everything from the next "Begin" through the following "End",
  1461.   and aligns all lines within the selection to the same margin position
  1462.   as the line that contains the "Begin".
  1463.  
  1464.                              See Also
  1465.  
  1466.  Adjust command.
  1467.   "Selections" in Chapter 6.
  1468.  
  1469. æKY Asm
  1470. æC                    Asm -- MC68xxx Macro Assembler
  1471.  
  1472. Asm [option…] [file…]  < file > listing ≥ progress
  1473.  -addrsize size          # set size of address display
  1474.  -blksize blocks         # use blocks * 512 byte I/O buffers
  1475.  -case on                # distinguish between upper and lower case
  1476.  -case obj[ect]          # preserve case in object file
  1477.  -case off               # ignore case (default)
  1478.  -c[heck]                # syntax check only, don't create object file
  1479.  -d[efine] name          # equivalent to: name EQU 1
  1480.  -d[efine] name=value    # equivalent to: name EQU value
  1481.  -d[efine] &name         # equivalent to: &name SET[AC] 1
  1482.  -d[efine] &name=value   # equivalent to: &name SET[AC] value
  1483.  -e[rrlog] file          # write errors and warnings to file
  1484.  -f                      # suppress page ejects in listing
  1485.  -font name[,size]       # set listing font and size
  1486.  -h                      # suppress page headers in listing
  1487.  -i directory,…          # search for includes in directory,…
  1488.  -l                      # write full listing to output
  1489.  -lo file                # listing output file or directory
  1490.  -model far              # allow generation of load-time relocatable 32-bit references 
  1491.  -model near             # prohibit generation of load-time relocatable 32-bit
  1492.                          #    references (the default)
  1493.  -o objname              # generate code in file or directory objname
  1494.  -pagesize l[,w]         # set listing page length and width
  1495.  -print mode             # equivalent to: PRINT mode
  1496.  -p                      # write progress information to diagnostics
  1497.  -s                      # write short listing to output
  1498.  -sym off                # no SADE records
  1499.  -sym on|full            # full SADE records; can modify with [,nolines] 
  1500.                          # [,notypes] [,novars]
  1501.  -t                      # write time and total lines to diagnostics
  1502.  -w                      # suppress warnings
  1503.  -wb                     # suppress warnings on branch instructions
  1504.  
  1505. Status codes returned:
  1506.   0    No errors detected in any of the files assembled.
  1507.   1    Parameter or option errors.
  1508.   2    Errors detected.
  1509.  
  1510.                            Description
  1511.  
  1512.   Assembles the specified assembly-language source files. One or more
  1513.   filenames may be specified. If no filenames are specified, standard
  1514.   input is assembled and the file "a.o" is created. By convention,
  1515.   assembly-language source filenames end in the suffix ".a". Each file
  1516.   is assembled separately—assembling file name.a creates object file
  1517.   name.a.o. The object filename can be changed with the -o option.
  1518.  
  1519.   See the MPW 3.0 Assembler Reference for more information about the
  1520.   assembly language. The first Commando dialog box for this command
  1521.   is reproduced here for convenience.
  1522.  
  1523.  
  1524.                              Examples
  1525.  
  1526.   Asm -w -l Sample.a Memory.a -d Debug
  1527.  
  1528.   Assembles Sample.a and Memory.a, producing object files Sample.a.o
  1529.   and Memory.a.o. Suppresses warnings and defines the name Debug as
  1530.   having the value 1. Two listing files are generated: Sample.a.lst
  1531.   and Memory.a.lst. (Sample.a and Memory.a are located in the AExamples
  1532.   directory.)
  1533.  
  1534.                             See Also
  1535.  
  1536.   MPW3.0 Assembler Reference.
  1537.  
  1538. æKY Backup
  1539. æC                     Backup -- folder file backup
  1540.  
  1541. Backup [option…] -from folder -to folder [file…]  > commands ≥ progress
  1542.  -a                      # copy all files in "from" not in "to"
  1543.  -alt                    # alternate prompts for disk drives
  1544.  -c                      # create "to" folders if they don't exist
  1545.  -check checkopt,…       # produce reports based on checkopt
  1546.                          # checkopt=from     "from" not in "to"
  1547.                          #          to       "to" not in "from"
  1548.                          #          allfroms "from" not in "to" even if none
  1549.                          #          alltos   "to" not in "from" even if none
  1550.                          #          folders  "from" folders not in "to"
  1551.                          #          newer    "to"s newer than "from"s
  1552.  -co filename            # redirect -check reports to filename
  1553.  -compare [only][,'opts']# write compare commands for out-of-date files
  1554.  -d                      # write delete commands for files in "to" not in "from"
  1555.  -do [only][,'command']  # write the command string specified by command…
  1556.  -e                      # eject disk when done
  1557.  -from folder|drive      # specify source folder or drive (1 or 2)
  1558.  -l                      # write directory listing of "from" files
  1559.  -lastcmd 'command'      # write the command string as the last command
  1560.  -level n                # restrict -a and -d to files beyond level n
  1561.  -m                      # multi-disk -- more than one "from" or "to" disk
  1562.  -n                      # show folder nesting by indenting commands 
  1563.  -p                      # write progress information to diagnostics
  1564.  -r                      # recursively process nested folders
  1565.  -revert                 # revert "to" files to their "from" state
  1566.  -since date[,time]|fname# process only files since specified time
  1567.  -sync                   # synchronize both source and destination folders
  1568.  -t type                 # process only files of specified type
  1569.  -to folder|drive        # specify destination folder or drive (1 or 2)
  1570.  -y                      # suppress duplicate -y option
  1571.  
  1572. Status codes returned:
  1573.   0    No errors; Shell duplicate commands have been generated or filenames were     listed.
  1574.   1    Parameter or option errors.
  1575.   3    No errors and no files to duplicate or list.
  1576.   Note:  Backup returns a status code of 3 when no files need copying. 
  1577.        If no files are copied because none of the files in the source folder 
  1578.        exists in the destination folder, Backup also reports a warning to 
  1579.        the diagnostic output file. If there are no name matches, it is 
  1580.        possible that your from/to pathnames were specified incorrectly. 
  1581.        Hence, Backup lets you know of the possible error. Backup does not 
  1582.        report this as an error if you use the  -l, -a, or -since option.
  1583.  
  1584.                            Description
  1585.  
  1586.   Files in a source ("from") folder are copied to a destination ("to")
  1587.   folder based on the modification date. By default, only files that
  1588.   already exist in both the source and destination folders are candidates
  1589.   for copying. (The -a option can override this default.) Backup does
  1590.   not actually make the copies. Instead, it generates a script of MPW
  1591.   Shell duplicate commands.
  1592.  
  1593.   Backup’s default operation is based on the premise that you already
  1594.   have an existing folder on two sets of disks (generally a hard disk
  1595.   and a set of 3.5-inch disks—drive numbers may be specified as folder
  1596.   "names") and that you want to make sure that the files on one of
  1597.   the disks are the same as the files on the other disk. Thus, it is
  1598.   the files on the destination ("to") disk that determine which files
  1599.   can be copied from the source ("from") disk.
  1600.  
  1601.   A Shell duplicate command is generated to the standard output file
  1602.   if
  1603.  
  1604.     • a file on a source disk also exists on the destination disk,
  1605.     and
  1606.  
  1607.     • the modification date of the source is newer than that of the
  1608.     destination.
  1609.  
  1610.   In addition to the basic function of generating Shell duplicate commands,
  1611.   Backup also provides these services:
  1612.  
  1613.     • Folders can be recursively processed, allowing processing of
  1614.     all folders and subfolders contained within folders (-r).
  1615.  
  1616.     • Compare commands can be generated for out-of-date files of
  1617.     type TEXT to discover why the files are different (-compare).
  1618.  
  1619.     • Filenames that exist on one disk and not on the other can be
  1620.     displayed
  1621.  
  1622.   (-check from,to).
  1623.  
  1624.     • File folder names that don’t exist on the destination can be
  1625.     displayed
  1626.  
  1627.   (-check folders).
  1628.  
  1629.     • Filenames in the destination that are newer than the source
  1630.     can be displayed
  1631.  
  1632.   (-check newer).
  1633.  
  1634.  
  1635.                              Examples
  1636.  
  1637.   backup  -from :HDfolder:  -e
  1638.  
  1639.   Check that all files on the disk in drive 1 (-to is omitted, so "-to
  1640.   1" is implied) are up to date with respect to the files in :HDfolder:.
  1641.   If they are, the disk in drive 1 is ejected. If not, the appropriate
  1642.   Duplicate commands are generated to update the out-of-date files
  1643.   on the disk in drive 1. An Eject 1 command is generated to eject
  1644.   the disk after the Duplicate commands are processed.
  1645.  
  1646.   backup  -r  -from FServer:MPW:  -to HD:MPW:  -check folders
  1647.  
  1648.   Recursively process (-r) all the files in all the folders on FServer:MPW:
  1649.   to make sure that the files on HD:MPW: are up-to-date. Appropriate
  1650.   Duplicate commands are generated to copy the out-of-date files from
  1651.   the folders in FServer:MPW: to the folders in HD:MPW:. It is assumed
  1652.   that the folder names in HD:MPW: are the same as the folder names
  1653.   in FServer:MPW:. Any folders in FServer:MPW: that don’t exist in
  1654.   HD:MPW are skipped. Because the -check option is specified, a list
  1655.   of all the skipped folders is written to the diagnostic file.
  1656.  
  1657.   Limitations Multi-disk operation (-m) is not supported with recursion
  1658.   (-r).
  1659.  
  1660.   The -e option is ignored when -m is specified.
  1661.  
  1662.   Only drive numbers 1 and 2 are supported, and they are assumed to
  1663.   be ejectable 3.5-inch disk drives.
  1664.  
  1665. æKY Beep
  1666. æC                       Beep -- generate tones
  1667.  
  1668. Beep [note [,duration [,level]]]…
  1669.  #   duration is given in sixtieths of a second (default is 15)
  1670.  #   sound level is given as a number from 0 to 255 (default is 128)
  1671.  
  1672. Status code returned:
  1673.    0    no errors.
  1674.  
  1675.  
  1676.                            Description
  1677.  
  1678.   For each parameter, Beep produces the given note for the specified
  1679.   duration and sound level on the Macintosh speaker. If no parameters
  1680.   are given, a simple beep is produced.
  1681.  
  1682.   Note is one of the following:
  1683.  
  1684.     • A number indicating the count field for the square wave generator,
  1685.     as described in chapter "Summary of the Sound Driver" of Inside
  1686.     Macintosh.
  1687.  
  1688.     • A string in the following format:
  1689.  
  1690.   [ n ] letter [ # | b ]
  1691.  
  1692.   n is an optional number between –3 and 3 indicating the octaves below
  1693.   or above middle C, followed by a letter indicating the note (A–G)
  1694.   and an optional sharp (#) or flat (b) sign. Note that any sharps
  1695.   (#) must be enclosed in quotation marks—otherwise they will be interpreted
  1696.   as comment delimiters.
  1697.  
  1698.   The optional duration is given in sixtieths of a second. The default
  1699.   duration is 15 (one-quarter second).
  1700.  
  1701.   The optional sound level is given as a number from 0 to 255. The
  1702.   default level is 128.
  1703.  
  1704.  
  1705.                              Examples
  1706.  
  1707.   Beep
  1708.  
  1709.   Produce a simple beep on the speaker.
  1710.  
  1711.   Beep 2C,20 '2C#,40' 2D,60
  1712.  
  1713.   Play the three notes specified: C , C sharp, and D—all two octaves
  1714.   above middle C—for one-third, two-thirds, and one full second, respectively.
  1715.   Notice that the second parameter must be quoted; otherwise the sharp
  1716.   character (#) would indicate a comment.
  1717.  
  1718. æKY Begin
  1719. æC                      Begin  -- group commands
  1720.  
  1721. Begin
  1722.  command…
  1723. End
  1724.  
  1725. The status code of the last command executed is returned. 
  1726. (If no commands appear between Begin and End, 0 is returned.)
  1727.  
  1728.                            Description
  1729.  
  1730.   Groups commands for pipe specifications, conditional execution, and
  1731.   input/output specifications. Carriage returns must appear at the
  1732.   end of each line as shown above, or be replaced with semicolons (
  1733.   ; ). If the pipe symbol (|), conditional execution operators (&&
  1734.   and ||), or input/output specifications (<, >, >>, ≥, ≥≥, ∑, ∑∑)
  1735.   are used, the operator must appear after the End command and applies
  1736.   to all of the enclosed commands.
  1737.  
  1738.     • Note: Begin and End behave like left and right parentheses.
  1739.     Once the Begin command has been executed, the Shell will not
  1740.     execute any of the subsequent commands until it encounters the
  1741.     End command, so that input/output specifications can be processed.
  1742.  
  1743.  
  1744.                              Examples
  1745.  
  1746.   The following commands save the current variables, exports, aliases,
  1747.   and menus in the file SavedState.
  1748.  
  1749.   Begin
  1750.     Set
  1751.     Export
  1752.     Alias
  1753.     AddMenu
  1754.   End > SavedState
  1755.  
  1756.   Notice that the output specification following "End" applies to all
  1757.   of the commands within the Begin…End control command. This command
  1758.   is identical to the following:
  1759.  
  1760.   (Set; Export; Alias; AddMenu) > SavedState
  1761.  
  1762.   The commands Set, Export, Alias, and AddMenu write their output in
  1763.   the form of commands; these commands can be executed to redefine
  1764.   variables, exports, aliases, and menus, respectively. Therefore,
  1765.   after executing the above commands, the command
  1766.  
  1767.   Execute SavedState
  1768.  
  1769.   will restore all of these definitions. You must "execute" the script
  1770.   so that the variables and aliases are applied to the current scope.
  1771.  
  1772.     • Note: This technique is used in the Suspend script to save
  1773.     state information. (You might want to take a look at Suspend,
  1774.     which also saves the list of open windows and the current directory.)
  1775.     The Resume file runs the file that Suspend creates, restoring
  1776.     the various definitions, reopening the windows, and resetting
  1777.     the current directory.
  1778.  
  1779. æKY Break
  1780. æC                   Break -- break from For or Loop
  1781.  
  1782. Break [If expression]
  1783.  
  1784. Status codes returned:
  1785.   0    No errors detected.
  1786.   –3   Break is found outside a For…End or Loop…End, or the parameters
  1787.        to Break are incorrect.
  1788.   –5   Invalid expression.
  1789.  
  1790.                            Description
  1791.  
  1792.   If expression is nonzero, Break terminates execution of the immediately
  1793.   enclosing For or Loop command. (Null strings are considered zero.)
  1794.   If the "If expression" is omitted, the break is unconditional. (For
  1795.   a definition of expression, see the Evaluate command.)
  1796.  
  1797.  
  1798.                              Examples
  1799.  
  1800.   Set Exit 0
  1801.   For file in Startup UserStartup Suspend Resume Quit
  1802.     EnTab "{file}" > temp
  1803.     Break If {Status} != 0
  1804.     Rename -y temp "{file}"
  1805.     Print -h "{file}"
  1806.     Echo "{file}"
  1807.   End
  1808.  
  1809.   This For loop entabs and prints each of the special MPW scripts;
  1810.   the Break command terminates the loop if a nonzero status value is
  1811.   returned. (See the For command for further explanation of this example.)
  1812.  
  1813.   Set loopcount |
  1814.     Loop
  1815.     Break if {loopcount} > 10
  1816.     Echo "Loop Number {loopcount}"
  1817.     Evaluate loopcount +=1
  1818.   End
  1819.  
  1820.   This example loops until the variable {loopcount} is greater than
  1821.   10. Use of the Evaluate command is also demonstrated.
  1822.  
  1823.  
  1824.                              See also 
  1825.  
  1826.   For, Loop, and If commands.
  1827.  
  1828.   Evaluate command (for a description of expressions).
  1829.  
  1830.   "Structured Commands" in Chapter 5.
  1831.  
  1832. æKY Browser
  1833. æC                Browser -- invoke Marker Browser
  1834.  
  1835.                   # The MPW Browser command is used to navigate source files or other text.  It 
  1836.                   # presents a window containing a list of the files in the current directory
  1837.                   # and, for the selected file, a list of markers.  Double-clicking on the marker
  1838.                   # opens the file with the selection point at the marker.  Entering a marker name
  1839.                   # in a text box searches all files in the directory for that marker, and if found 
  1840.                   # opens the file with the selection point at the marker.
  1841.  
  1842. æKY BuildCommands
  1843. æC                BuildCommands -- show build commands
  1844.  
  1845. BuildCommands program [option…] > commands
  1846.  option…                 # Make command options
  1847.  
  1848. Status code 0 is returned if the build commands are generated 
  1849. without error.  If an error occurs, the status code returned by Make is returned.
  1850.  
  1851.                            Description
  1852.  
  1853.   BuildCommands writes to standard output the commands needed to build
  1854.   the specified program.
  1855.  
  1856.   Make is used to generate the build commands. If file program.make
  1857.   exists, it is used as the makefile. If not, file MakeFile is used.
  1858.  
  1859.   The specified options control the generation of the build commands.
  1860.   The options are passed directly to Make. BuildCommands is used to
  1861.   implement the Show Build Commands and Show Full Build Commands menu
  1862.   items in the Build Menu.
  1863.  
  1864.  
  1865.                              Examples
  1866.  
  1867.   Open {Worksheet}
  1868.  
  1869.   BuildCommands Count >> {Worksheet} ≥≥ Dev:StdOut
  1870.  
  1871.   Generates the build commands for Count. The Worksheet window is brought
  1872.   to the front. The build commands, or any errors generated by Make
  1873.   are written at the end of the Worksheet. The Show BuildCommands menu
  1874.   item is implemented using similar commands.
  1875.  
  1876.  
  1877.                              See also 
  1878.  
  1879.   "Building a Program:  An Introduction" in Chapter 2
  1880.  
  1881.       
  1882. æKY BuildMenu
  1883. æC                  BuildMenu -- create the Build menu
  1884.  
  1885. Status codes returned:
  1886.  0    is always returned.
  1887.  
  1888.                            Description
  1889.  
  1890.   Creates the Build menu shown below. Each of the items in the menu
  1891.   is described in Chapter 3 of the MPW Manual.
  1892.  
  1893.  
  1894.                              Examples
  1895.  
  1896.   BuildMenu
  1897.  
  1898.   Creates the Build menu. This command should appear in the UserStartup
  1899.   file to create the Build menu.
  1900.  
  1901.  
  1902.                              See also 
  1903.  
  1904.   "Building a Program: An Introduction" in Chapter 2.
  1905.  
  1906. æKY BuildProgram
  1907. æC             BuildProgram -- build the specified program
  1908.  
  1909. Status code 0 is returned if the build is completed without error. 
  1910. If an error occurs during the generation of the build commands, the status 
  1911. value returned by Make is returned. If an error occurs during the build, the 
  1912. Status value returned by the build step that detected the error (such as Asm 
  1913. or Link) is returned.
  1914.  
  1915. BuildProgram program [option…] > log
  1916.  option…                 # Make command options
  1917.  
  1918.                            Description
  1919.  
  1920.   Builds the specified program. A simple transcript of the build, including
  1921.   timing information and commands used to do the build, is written
  1922.   to standard output.
  1923.  
  1924.   Make is used to determine the commands needed to do the build. If
  1925.   file
  1926.  
  1927.   program.make exists, it is used as the makefile. If not, the file
  1928.   MakeFile is used.
  1929.  
  1930.   The options specified are passed directly to Make; they control the
  1931.   generation of the build commands. BuildProgram is used to implement
  1932.   the Build and Full Build menu items in the Build menu.
  1933.  
  1934.  
  1935.                              Examples
  1936.  
  1937.   Open {Worksheet}
  1938.  
  1939.   BuildProgram -e Count >> {Worksheet} ≥≥ Dev:StdOut
  1940.  
  1941.   Completely rebuilds Count. The Worksheet window is brought to the
  1942.   front. The transcript of the build and any errors are written at
  1943.   the end of the Worksheet. The Full Build menu command is implemented
  1944.   using similiar commands.
  1945.  
  1946.  
  1947.                              See also 
  1948.  
  1949.   "Building a Program:  An Introduction" in Chapter 2
  1950.  
  1951. æKY C
  1952. æC                            C -- C compiler
  1953.  
  1954. C [option…] [file]   < file > preprocessor ≥ progress
  1955.     -b                      # put string constants into code and generate PC-relative references
  1956.                             #   for function addresses
  1957.     -b2                     # implies '-b' above, and allows string constants to be overlaid
  1958.     -b3                     # overlaid string constants in code (but A5-relative references
  1959.                             # for function addresses)
  1960.     -bigseg                 # generate single large (>32K) code segment, 68020 only   
  1961.     -c                      # syntax check only, don't create object file
  1962.     -d name                 # equivalent to: #define name 1
  1963.     -d name=string          # equivalent to: #define name string
  1964.     -e                      # write preprocessor results to output
  1965.     -e2                     # implies '-e' above, and strips comments
  1966.     -elems881               # generate MC68881 code for transcendentals
  1967.     -i directory            # search for includes in directory
  1968.     -k directory            # create load/dump files in directory
  1969.     -m                      # generate 32-bit references for data (less efficient code)
  1970.     -mbg ch8                # v2.0 compatible macsbug symbols
  1971.     -mbg off                # no macsbug symbols in the code 
  1972.     -mbg on|full            # full macsbug symbols
  1973.     -mbg <n>                # macsbug symbols to length <n> (<n> can be 0..255)
  1974.     -mc68020                # generate MC68020 code 
  1975.     -mc68881                # generate MC68881 code for arithmetic operations
  1976.     -model farCode|         # generate load-time relocatable 32-bit references for
  1977.         farData|far         #   code, data, or both
  1978.     -model nearCode|        # generate 16-bit references for code, data, or both 
  1979.         nearData|near       #   (the default)
  1980.     -n                      # Turn pointer assignment incompatibility errors into warnings
  1981.     -notonce                # do not automatically suppress multiple inclusion of files
  1982.     -o objname              # generate code in file or directory objname
  1983.     -opt off                # don't apply code optimizations
  1984.     -opt on | full          # choose level of code optimization ( on is default );
  1985.                             #    can modify with [,nopeep] [,nocse]
  1986.                             #    ( no peephole, no common subexpression)
  1987.     -p                      # write progress information to diagnostic
  1988.     -r                      # warn on calling a function that has no definition
  1989.     -s segment              # generate code in segment
  1990.     -sym off                # don't generate SADE records
  1991.     -sym on | full          # generate SADE records; can modify with [,nolines] [,notypes] [,novars]
  1992.     -t                      # write compilation time to diagnostic
  1993.     -trace always|never     # enable/disable calls to profiler or MacApp debugger
  1994.                             #   (overrides #pragma trace on|off)
  1995.     -trace on|off           # enable/disable calls to profiler or MacApp debugger
  1996.                             #   (subject to #pragma trace on|off)
  1997.     -u name                 # equivalent to: #undef name
  1998.     -warnings on|off|full   # set warning level; "on" is the default
  1999.     -y directory            # create temporary files in directory
  2000.  
  2001. Status codes returned:
  2002.   0    Successful completion.
  2003.   1    Errors occurred.
  2004.  
  2005.                            Description
  2006.  
  2007.   Compiles the specified C source file. Compiling file Name.c creates
  2008.   object file Name.c.o. (By convention, C source filenames end in a
  2009.   ".c" suffix.) If no filenames are specified, standard input is compiled
  2010.   and the object file "c.o" is created.
  2011.  
  2012.   (Note that SADE object file information cannot be generated for standard
  2013.   input source files.)
  2014.  
  2015.   See the MPW 3.0 C Reference Manual for details of the C language
  2016.   definition.
  2017.  
  2018.                              Examples
  2019.  
  2020.   C -p Sample.c
  2021.  
  2022.   Compiles Sample.c, producing the object file Sample.c.o. Writes progress
  2023.   information to diagnostic output. (Sample.c is found in Examples:CExamples.)
  2024.  
  2025.  
  2026.                              See also 
  2027.  
  2028.   MPW3.0C Reference.
  2029.  
  2030.  
  2031. æKY Canon
  2032. æC                   Canon -- canonical spelling tool
  2033.  
  2034. Canon [option…] dictionary [file…]   < file > new
  2035.  -s                      # case sensitive replacement
  2036.  -a                      # assembler identifiers (include $, %, @)
  2037.  -c n                    # consider only the first n characters
  2038.  
  2039. Status codes returned:
  2040.   0    All files processed successfully.
  2041.   1    Error in command line.
  2042.   2    Other errors.
  2043.  
  2044.                            Description
  2045.  
  2046.   Canon copies the specified files to standard output, replacing identifiers
  2047.   with the canonical spellings given in dictionaryFile. If no files
  2048.   are specified, standard input is processed.
  2049.  
  2050.   DictionaryFile is a text file that specifies the identifiers to be
  2051.   replaced and their new (or canonical) spellings. Identifiers are
  2052.   defined as a letter followed by any number of letters or digits.
  2053.   (The underscore character ( _ ) is also considered a letter.) Each
  2054.   line in the dictionary contains either a pair of identifiers or a
  2055.   single identifier:
  2056.  
  2057.     • If two identifiers appear, the first is the identifier to replace,
  2058.     and the second is its canonical spelling. For example, the dictionary
  2059.     entry
  2060.  
  2061.     NIL NULL # change NIL to NULL
  2062.  
  2063.     changes each occurrence of "NIL" to "NULL".
  2064.  
  2065.     • A single identifier specifies both the identifier to match
  2066.     and its canonical spelling. This feature is useful because the
  2067.     matching may not be case sensitive or restricted to a fixed number
  2068.     of characters. (See the "Options" section on the next page.)
  2069.     For example, the dictionary entry
  2070.  
  2071.     true
  2072.  
  2073.     changes all occurrences of "TRUE", "True", "tRUE", and so on to "true".
  2074.  
  2075.   You can specify a left context for the first identifier on each line
  2076.   of the dictionary by preceding it with a sequence of nonidentifier
  2077.   characters. Replacement will then occur only if the left context
  2078.   in the input file exactly matches the left context in the dictionary.
  2079.   For example, if C structure component upperLeft should be replaced
  2080.   with topLeft, the dictionary might include the following:
  2081.  
  2082.   .upperLeft topLeft
  2083.   ->upperLeft topLeft
  2084.  
  2085.   You can include comments in the dictionary file by using the # symbol:
  2086.   everything from the # to the end of the line is ignored.
  2087.  
  2088.     • Note: The file Canon.Dict is a sample dictionary file that’s
  2089.     included with MPW. (See the "Examples" section below.)
  2090.  
  2091.  
  2092.                              Examples
  2093.  
  2094.   The file Canon.Dict, in the Tools folder, contains a list of all
  2095.   of the identifiers used in the Standard C library and the Inside
  2096.   Macintosh C interfaces. This list was made from the Library Index
  2097.   in the MPW 2.0 C Reference. The entries in Canon.Dict look like the
  2098.   following:
  2099.  
  2100.   abbrevDate
  2101.   ABCallType
  2102.   abortErr
  2103.   ABProtoType
  2104.   abs
  2105.   acos
  2106.   activateEvt
  2107.   …
  2108.  
  2109.   The following command copies the file Source.c to the file Temp;
  2110.   identifiers whose first eight characters match a dictionary entry
  2111.   are replaced with that entry.
  2112.  
  2113.   Canon -c 8 {MPW}Tools:Canon.Dict Source.c > Temp
  2114.  
  2115.   The -c 8 option is useful when porting source code from other systems
  2116.   where only eight characters are significant.
  2117.  
  2118.     • Note: The list of Pascal identifiers used in the Inside Macintosh
  2119.     interface is almost identical to the list used in C. The dictionary
  2120.     Canon.Dict can also be used to port Pascal programs from other
  2121.     systems, as long as you use the canonical capitalizations for
  2122.     the various Standard C library identifiers.
  2123.  
  2124.   Limitations The maximum line length in the dictionary file is 256
  2125.   characters. Longer lines are considered an error. Identifiers and
  2126.   words in comment sections are replaced.
  2127.  
  2128. æKY Catenate
  2129. æC                    Catenate -- concatenate files
  2130.  
  2131. Catenate [file…]  < file > catenation
  2132.  
  2133. Status codes returned:
  2134.   0    All files were processed successfully.
  2135.   1    One or more files were not found.
  2136.   2    An error occurred in reading or writing.
  2137.  
  2138.                            Description
  2139.  
  2140.   Catenate reads the data fork of each file in sequence and writes
  2141.   it to standard output. If no input file is given, Catenate reads
  2142.   from standard input. None of the input files may be the same as the
  2143.   output file.
  2144.  
  2145.  
  2146.                              Examples
  2147.  
  2148.   Catenate Makefile.a
  2149.  
  2150.   Writes Makefile.a to the active window immediately following the
  2151.   command.
  2152.  
  2153.   Catenate File1 File2 > CombinedFile
  2154.  
  2155.   Concatenates the first two files and places the result in the third.
  2156.   If CombinedFile doesn’t exist, it will be created; if it exists,
  2157.   it will be overwritten.
  2158.  
  2159.   Set selection "`Catenate §`"
  2160.  
  2161.   Captures the selection from the target window in the Shell variable
  2162.   {selection}.
  2163.  
  2164.   Catenate >> {Worksheet}
  2165.  
  2166.   Appends all subsequently entered text to the Worksheet window (until
  2167.   you indicate end-of-file by pressing Command-Enter).
  2168.  
  2169.   Warning Beware of commands such as
  2170.  
  2171.   Catenate File1 File2 > File1
  2172.  
  2173.   The above command will cause the original data in File1 to be lost.
  2174.   To append one file to another, use the form
  2175.  
  2176.   Catenate File2 >> File1
  2177.  
  2178.  
  2179.                              See also 
  2180.  
  2181.   Duplicate command.
  2182.  
  2183.   "Redirecting Input and Output" in Chapter 5.
  2184.  
  2185. æKY CFront
  2186. æC                     CFront -- C++ to C translator
  2187.  
  2188. CFront [option…] [file…] < file > intermediate output ≥ progress
  2189.     -a                      # force ANSI-style intermediate C code (default)
  2190.     -a0                     # force K&R-style (pre-ANSI) intermediate C code
  2191.     -a1                     # force ANSI-style intermediate C code (default)
  2192.     -c                      # intermediate code to standard output; no object file
  2193.     -d name                 # equivalent to: #define name 1
  2194.     -d name=string          # equivalent to: #define name string
  2195.     -e                      # write preprocessor results to output
  2196.     -e2                     # implies '-e' above, and strips comments
  2197.     -elems881               # generate MC68881 code for transcendentals
  2198.     -f filename             # act as if input comes from named file when it actually is from stdin 
  2199.     -f1                     # send text version of C code to C compiler (no token stream)
  2200.     -i directory            # search for includes in directory
  2201.     -mc68020                # generate MC68020 code 
  2202.     -mc68881                # generate MC68881 code for arithmetic operations
  2203.     -mtbl0                  # suppress output of method tables for Object Pascal Classes
  2204.     -mtbl1                  # force output of method tables for Object Pascal Classes
  2205.     -n                      # Turn pointer assignment incompatibilty errors into warnings
  2206.     -p                      # write progress information to diagnostic
  2207.     -s segment              # generate code in segment
  2208.     -u name                 # equivalent to: #undef name
  2209.     -vtbl0                  # suppress output of virtual tables for ordinary class
  2210.     -vtbl1                  # force output of virtual tables for ordinary class
  2211.     -vtbl2                  # new improved output algorithm for virtual tables
  2212.     -w                      # suppress warnings
  2213.     -w1                     # generate additional warnings from CFront
  2214.     -w3                     # passed through to C compiler (supresses unused warnings)
  2215.     -y directory            # create temporary files in directory
  2216.     -z0                     # force 'inline' functions to be non-inline
  2217.     -z3                     # supress name encoding of local vars and struct members (default)
  2218.     -z4                     # encode names of local vars and struct members
  2219.     -z6                     # force enums always to be int variables
  2220.     -z7                     # relax requirement on static class member initialization 
  2221.  
  2222. æKY CheckIn
  2223. æC                CheckIn -- check a file into a project
  2224.  
  2225. CheckIn -w | -close | ([options…] files…) > progress
  2226.  -a                 # checkin all files in current directory
  2227.  -b                 # check in files… as branches
  2228.  -c                 # cancel if conflict occurs (avoids dialog)
  2229.  -cf file           # the comment is contained in file.
  2230.  -close             # close the Check In window
  2231.  -cs comment        # a description of changes made to the file
  2232.  -delete            # delete the file after checking it in
  2233.  -m                 # check out the files for modification after checking in
  2234.  -n                 # answer no to all dialogs (avoids dialogs)
  2235.  -new               # add a new file to the project
  2236.  -p                 # write progress information to standard output
  2237.  -project project   # name of project that contains the files
  2238.  -t task            # a short description of task accomplished
  2239.  -touch             # touch the mod date of file after checking in
  2240.  -u user            # name of current user
  2241.  -verify            # verify the contents of the checked in file
  2242.  -w                 # open the Check In window
  2243.  -y                 # answer yes to all dialogs (avoids dialogs)
  2244.  
  2245. Status codes returned:
  2246.   0    No errors.
  2247.   1    Syntax error.
  2248.   2    Error in processing.
  2249.   3    System error.
  2250.  
  2251.                            Description
  2252.  
  2253.   Return ownership of the specified files to Projector and save all
  2254.   changes as new revisions. The default is to leave you with a read-only
  2255.   copy of the file.
  2256.  
  2257.   File must be an HFS pathname. Projector determines the project each
  2258.   file belongs to by inspecting the file's resource fork. Since Projector
  2259.   puts the name of the project in the resource fork of checked-out
  2260.   files, files belonging to different projects can be checked in with
  2261.   a single command.
  2262.  
  2263.   If the -a (all) option is used instead of file..., Projector examines
  2264.   all files in the current directory and checks in all files in the
  2265.   current directory that have been checked out for modification. The
  2266.   files are checked into their respective projects.
  2267.  
  2268.   To add a new file to the project, use the -new option.
  2269.  
  2270.   When the file is checked in, Projector automatically increments the
  2271.   revision number by one. For example, if revision 2.17 was checked
  2272.   out, the new revision will be 2.18. To override this, use the ProjectInfo
  2273.   command to find the revision number, increase it by the amount desired,
  2274.   and then check the file in, using the "filename,rev" notation. For
  2275.   example, if file.c revision 2.17 was checked out, you could check
  2276.   it in as file.c,3.0 to jump to the next major revision level.
  2277.  
  2278.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  2279.   symbols used in Projector commands.
  2280.  
  2281.  
  2282.                              Examples
  2283.  
  2284.   CheckIn file.c -cs "added some comments"
  2285.  
  2286.   Check in file.c to the current project. A new revision of file.c
  2287.   is created and the user is left with a read-only copy of the file.
  2288.   The comment is saved with the new revision. Because no revision number
  2289.   is specified, Projector simply increases the revision number by one.
  2290.  
  2291.   CheckIn file.c interface.c,5 -t "Added -x option"
  2292.  
  2293.   -cf commentFile
  2294.  
  2295.   This command checks in two files reading the comment from the file
  2296.   commentFile. The task is also saved with the new revisions. The user
  2297.   is left with read-only copies of the files. The new revision for
  2298.   interface.c is revision 5.
  2299.  
  2300.   CheckIn hd:work:file.c hd:work:main.c -m
  2301.  
  2302.   The files to be checked in are hd:work:file.c and :main.c. After
  2303.   the command executes, the user still has modifiable copies of the
  2304.   files.
  2305.  
  2306.   CheckIn -new file.c
  2307.  
  2308.   To check a new file into the project use the -new option. The above
  2309.   command adds file.c to the current project.
  2310.  
  2311.   CheckOut -project Zoom∫Utilities∫MyProject file.c -m
  2312.  
  2313.   ...edit the file...
  2314.  
  2315.   CheckIn -project Zoom∫Utilities∫MyProject file.c -b
  2316.  
  2317.   The preceding command sequence illustrates the usefulness of the
  2318.   -b option. In this case, the user checked out a write-privileged
  2319.   copy of the latest revision of file.c from the current project, edited
  2320.   the file, and then, using the branch option, checked in the file
  2321.   on a branch.
  2322.  
  2323.  
  2324.                              See also 
  2325.  
  2326.   CheckOut and CheckOutDir.
  2327.  
  2328. æKY CheckOut
  2329. æC              CheckOut -- check a file out from a project
  2330.  
  2331. CheckOut -w | -close | ([options…] files…) > progress
  2332.  -a                    # check out all the files in the current project
  2333.  -b                    # checkout specified files on a new branch
  2334.  -c                    # cancel if conflict occurs (avoids dialog)
  2335.  -cancel               # cancel the checkout of the files
  2336.  -cf file              # the comment is contained in files
  2337.  -close                # close the Check Out window
  2338.  -cs comment           # a short description of changes
  2339.  -d dir                # directory where the checked out files should go
  2340.  -m                    # check out a modifiable copy of the file
  2341.  -n                    # answer no to all dialogs (avoids dialogs)
  2342.  -newer                # checkout latest copy of all files in the project
  2343.  -noTouch              # don't touch the mod date of the checked out files
  2344.  -open                 # open the files after checking out
  2345.  -p                    # write progress information to standard output
  2346.  -project project      # name of project that contains the files
  2347.  -r                    # recursively checkout files
  2348.  -t task               # a short description of task accomplished
  2349.  -u user               # name of current user
  2350.  -update               # checkout latest copy of all files you already have
  2351.  -verify            # verify the contents of the checked out file
  2352.  -w                    # open the Check Out window
  2353.  -y                    # answer yes to all dialogs (avoids dialogs)
  2354.  
  2355. Status codes returned:
  2356.   0    No errors.
  2357.   1    Syntax error.
  2358.   2    Error in processing.
  2359.   3    System error.
  2360.  
  2361.                            Description
  2362.  
  2363.   Under Projector, CheckOut obtains copies of file revisions from a
  2364.   project. The default is to check out read-only copies. Unless otherwise
  2365.   specified, copies are placed in the checkout directory associated
  2366.   with the project.
  2367.  
  2368.   If file is a leafname (that is, file.c), Projector checks out the
  2369.   latest revision of the file from the current project. If file specifies
  2370.   a revision (for example, file.c,22), that revision is checked out.
  2371.  
  2372.   If file is a partial or full HFS pathname (that is, :work:file.c
  2373.   or HD:work:file.c), the file does not go into the checkout directory.
  2374.   Instead, Projector checks out the file (that is, file.c) in the current
  2375.   project and places the copy in the specified HFS location (that is,
  2376.   in the :work: or HD:work: directory, respectively).
  2377.  
  2378.   Finally, file may be a Name. See the NameRevisions command for more
  2379.   information about Names. The Name is expanded and the corresponding
  2380.   revisions are checked out.
  2381.  
  2382.   To check out an old revision for modification, you must specify the
  2383.   -b (branch) option.
  2384.  
  2385.   If you are checking out revision 5 of file.c into hd:work and Projector
  2386.   determines that you already have that revision in the work directory,
  2387.   Projector will not recopy the data of revision 5. This is especially
  2388.   nice when you are checking out a revision for modification, and you
  2389.   already have a read-only copy of that revision.
  2390.  
  2391.   See Chapter 7 of MPW manual for complete definitions of the terms and
  2392.   symbols used in Projector commands.
  2393.  
  2394.  
  2395.                              Examples
  2396.  
  2397.   CheckOut -m -project Zoom∫Utilities∫MyProject file.c
  2398.  
  2399.   Checks out a write-privileged copy of the latest revision of file.c
  2400.   from the Zoom∫Utilities∫MyProject project. The file is placed in
  2401.   the checkout directory for the project.
  2402.  
  2403.   CheckOut -m file.c
  2404.  
  2405.   The above command checks out the latest revision of file.c for modification.
  2406.   The file is placed in the checkout directory for the project. If
  2407.   you already happen to have the latest revision of file.c in the checkout
  2408.   directory, then Projector only updates the 'ckid' resource of file.c
  2409.   to indicate that it is now a modifiable file.
  2410.  
  2411.   CheckOut -project Zoom∫Utilities∫Kerfroodi file.c,22
  2412.  
  2413.   The above command checks out a read-only copy of revision 22 of file.c
  2414.   from the Zoom∫Utilities∫Kerfroodi project. The file is placed in
  2415.   the checkout directory for the project.
  2416.  
  2417.   Project Zoom∫Utilities∫Kerfroodi
  2418.  
  2419.   CheckOut file.c -t "Fix Bug 7" -m -d "{Zoom}UtilitiesSrc:Kerfroodi"
  2420.  
  2421.   By setting the current project with the Project command you don’t
  2422.   need to specify a project on subsequent Projector commands. By setting
  2423.   the task other users will be able to see why you have checked out
  2424.   file.c. The files are placed in {Zoom}UtilitiesSrc:Kerfroodi.
  2425.  
  2426.   CheckOut -a -d HD:Work:Test
  2427.  
  2428.   The above example checks out read-only copies of all of the files
  2429.   in the current project and places the copies in the directory HD:work:Test.
  2430.  
  2431.   CheckOut -a -project Zoom∫ -r
  2432.  
  2433.   Checks out read-only copies of all files in the Zoom project and
  2434.   all of its subprojects. Its behavior is the same as if you had executed
  2435.   these commands individually:
  2436.  
  2437.   CheckOut -a -project Zoom∫
  2438.  
  2439.   CheckOut -a -project Zoom∫Voom
  2440.  
  2441.   CheckOut -a -project Zoom∫Utilities
  2442.  
  2443.   CheckOut -a -project Zoom∫Utilities∫MyProject
  2444.  
  2445.   ...
  2446.  
  2447.   You can conveniently update the read-only files (from the current
  2448.   project) in the current directory without affecting any files checked
  2449.   out for modification. To do this, use the -update option:
  2450.  
  2451.   CheckOut -update -d :
  2452.  
  2453.  
  2454.                              See also 
  2455.  
  2456.   CheckIn and CheckOutDir.
  2457.  
  2458. æKY CheckOutDir
  2459. æC  CheckOutDir -- specify the directory where checked out files will placed
  2460.  
  2461. CheckOutDir [-project project | -m] [-r] [-x | directory]
  2462.  -project project # name of project to associate with the checkout directory
  2463.  -m               # list the checkout directories of all root projects
  2464.  -r               # recursively set or display the checkout directories
  2465.  -x               # reset the checkout directories to ":"
  2466.  
  2467. Status codes returned:
  2468.   0    No errors.
  2469.   1    Syntax error.
  2470.   2    Error in processing.
  2471.   3    System error.
  2472.  
  2473.                            Description
  2474.  
  2475.   Under Projector, CheckOutDir changes the checkout directory associated
  2476.   with the current project to the HFS pathname directory. From this
  2477.   point on, files checked out of the named project are placed, by default,
  2478.   into this directory. The directory is created if it does not exist.
  2479.   When a project is mounted, the checkout directory is initially set
  2480.   to ":"—that is, the current directory.
  2481.  
  2482.   It is recommended that you put CheckOutDir commands immediately following
  2483.   the corresponding MountProject commands you place in your UserStartup
  2484.   file, script, or AddMenu for project initialization.
  2485.  
  2486.   If directory is missing, the checkout directory of the current project
  2487.   is written to standard output in the form of a CheckOutDir command.
  2488.  
  2489.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  2490.   symbols used in Projector commands.
  2491.  
  2492.  
  2493.                              Examples
  2494.  
  2495.   CheckOutDir HD:work:Test
  2496.  
  2497.   This command causes subsequent files in the current project to be
  2498.   checked out to the HD:work:Test folder.
  2499.  
  2500.   CheckOutDir
  2501.  
  2502.   CheckOutDir -project Zoom∫Utilities∫Test HD:work:Test
  2503.  
  2504.   The above command outputs the checkout directory of the current project
  2505.   in the form of a CheckOutDir command.
  2506.  
  2507.   CheckOutDir -project Zoom∫ -r
  2508.  
  2509.   CheckOutDir -project Zoom∫ :
  2510.  
  2511.   CheckOutDir -project Zoom∫Vroom :
  2512.  
  2513.   CheckOutDir -project Zoom∫Utilities :
  2514.  
  2515.   CheckOutDir -project Zoom∫Utilities∫Test HD:work:Test
  2516.  
  2517.   The -r option lets you display the checkout directory for the current
  2518.   project and all subprojects. In this case, only the sort project
  2519.   has a checkout directory setting that differs from the default.
  2520.  
  2521.   The -r option can also be used to set the checkout directories of
  2522.   a complex project to mirror the projects own hierarchical structure.
  2523.   For example:
  2524.  
  2525.   CheckOutDir -project Zoom∫ -r HD:Work:
  2526.  
  2527.   After executing the above command, listing the checkout directories
  2528.   for the projects under Zoom yields
  2529.  
  2530.   CheckOutDir -project Zoom∫ -r
  2531.  
  2532.   CheckOutDir -project Zoom∫ HD:work:
  2533.  
  2534.   CheckOutDir -project Zoom∫Vroom HD:Work:Vroom
  2535.  
  2536.   CheckOutDir -project Zoom∫Utilities HD:Work:Utilities
  2537.  
  2538.   CheckOutDir -project Zoom∫Utilities∫Test HD:Work:Utilities:Test
  2539.  
  2540.   Notice how the directory structure is similar to the project structure.
  2541.   The directories are created if they do not exist.
  2542.  
  2543.   The -m option lists the checkout directories of the root projects.
  2544.   For example
  2545.  
  2546.   CheckOutDir -m
  2547.  
  2548.   CheckOutDir -project Zoom∫ HD:Work:Zoom
  2549.  
  2550.   CheckOutDir -project Test∫ HD:Test
  2551.  
  2552.  
  2553.                              See also 
  2554.  
  2555.   MountProject, CheckIn, and CheckOut.
  2556.  
  2557. æKY Choose
  2558. æC   Choose -- choose or list network file server volumes and printers
  2559.  
  2560. Choose [option…] [[zone]:server[:volume] …]
  2561.  -askpw                # ask for server password (in a "safe" dialog box)
  2562.  -askvp                # ask for volume password (in a "safe" dialog box)
  2563.  -c                    # output in the form of further "Choose" commands.
  2564.  -cp                   # print driver name and type of current printer.
  2565.  -dr driverFileName    # name of printer driver file in system folder 
  2566.                        # (e.g. "LaserWriter")
  2567.  -guest                # log-in to the file server as a guest.
  2568.  -list                 # list entities (don't choose them).
  2569.  -p                    # print version information.
  2570.  -pr                   # choose printers (instead of file servers).
  2571.  -pw password          # specify server log-in password.
  2572.  -u username           # specify user name for server log-in.
  2573.  -v                    # verbose (print names of volumes really mounted).
  2574.  -vp volumePassword    # specify volume password (to mount it).
  2575.  -type type            # specify type of entity to list or choose (or '≈').
  2576.  
  2577.  Names take the form     "zone:server:volume"
  2578.  
  2579.  The wildcard '≈' may be used in place of a zone, server, volume or
  2580.  type name.  A leading ':' (empty zone name) or '*:' indicates the
  2581.  current zone.  A name of the form "…server:" will mount all volumes
  2582.  on the server, unless a specific volume name is given.
  2583.  
  2584. Status codes returned:
  2585.   0    No errors.
  2586.   1    Syntax error on command line.
  2587.   3    Any other error.
  2588.  
  2589.                            Description
  2590.  
  2591.   Choose noninteractively mounts or lists the specified AppleShare
  2592.   volumes or printers. Each name takes the form
  2593.  
  2594.   [zone]:[server[:volume]]
  2595.  
  2596.   ("Server" means any file or printer server.) The zone name is always
  2597.   optional and defaults to the current zone. A server name must be
  2598.   preceded by (at least) a colon. Volume names are only applicable
  2599.   to file servers.
  2600.  
  2601.   When mounting file server volumes, a server name is required. If
  2602.   a volume name is specified, only that volume is mounted. If the volume
  2603.   name is omitted, or if it is the wildcard character "≈", all volumes
  2604.   on the server are mounted:
  2605.  
  2606.   [zone]:server:volume
  2607.  
  2608.   [zone]:server[:≈]
  2609.  
  2610.   When -list is specified, the wildcard character "≈" may be used in
  2611.   place of names in all of the fields: "≈" in the zone field expands
  2612.   to all zones; "≈" in the server field expands to all servers in the
  2613.   specified zones; "≈" in the volume-name field expands to volumes
  2614.   on the specified servers (listing volumes on a server requires a
  2615.   server login—that is, as a user with a valid password or as a guest).
  2616.   If the wildcard character "≈" is used, it must be quoted so that
  2617.   the Shell will not expand it.
  2618.  
  2619.   The -list option also expands the next unspecified item in a name.
  2620.   A zone name followed by nothing else expands to a list of servers
  2621.   in that zone, and a server name followed by nothing else expands
  2622.   to a list of volumes on the server.
  2623.  
  2624.   If a "≈", ":" or "" character appears in a server, volume, or zone
  2625.   name, it may be quoted with the character "". This quoting mechanism
  2626.   supplements quoting already performed by the Shell.
  2627.  
  2628.   Any number of volumes may be mounted (though a system-dependent limit
  2629.   exists on the number of active server connections). Only one printer
  2630.   may be chosen at a time, since only one printer can be active.
  2631.  
  2632.   Server and volume passwords are case sensitive. More than one server
  2633.   and volume may be mounted with a single command, but the server and
  2634.   volume passwords must be the same for each, since at most one password
  2635.   of each type may be specified on the command line.
  2636.  
  2637.  
  2638.                              Examples
  2639.  
  2640.   Choose :Linker:Sources
  2641.  
  2642.   Mount the volume Sources on the server Linker, located in the current
  2643.   zone, using the default user name, server password, and volume password.
  2644.  
  2645.   Choose -v -guest 'Systems:Sources:Doc' 'Systems:Games:≈'
  2646.  
  2647.   Mount the volume Doc on the server Sources and every volume on the
  2648.   server Games in the zone Systems as a guest. Print the names of the
  2649.   volumes that are mounted by the command. List the names of all zones.
  2650.   Notice that the wildcard character "≈" is quoted.
  2651.  
  2652.   Choose -list 'Whale Zone:≈' 'Whale Zone:Moby Dick:≈' '≈:'
  2653.  
  2654.   List all file servers in the zone Whale Zone, all volumes on the
  2655.   file server Moby Dick in that zone (after logging in with the default
  2656.   user name and server password) and all zones (with their servers).
  2657.  
  2658.   Choose -pr -list ':≈'
  2659.  
  2660.   Choose -cp -pr Zarf:Kitchen Sink
  2661.  
  2662.   List all printers of the current type in the current zone. Print
  2663.   the name of the currently selected printer, then select the printer
  2664.   called Kitchen Sink in the zone Zarf.
  2665.  
  2666.   Choose -list -type Fortune Cookie Server '≈:≈'
  2667.  
  2668.   List all network entities of type Fortune Cookie Server in all zones.
  2669.  
  2670.  
  2671.                              See also 
  2672.  
  2673.   Unmount and Volumes commands.
  2674.  
  2675.  
  2676.  
  2677. æKY Clear
  2678. æC                     Clear -- clear the selection
  2679.  
  2680. Clear [-c count] selection [window]
  2681.  -c count                # repeat the Clear count times
  2682.  
  2683. Status codes returned:
  2684.   0    At least one instance of selection was found.
  2685.   1    Syntax error.
  2686.   2    Any other errors.
  2687.  
  2688.                            Description
  2689.  
  2690.   Finds selection and deletes its contents. The selection is not copied
  2691.   to the Clipboard. (For a definition of selection, see Chapter 6 of the
  2692.   MPW manual.)
  2693.  
  2694.   If window is specified, the Clear command acts on that window. It’s
  2695.   an error to specify a window that doesn’t exist. If no window is
  2696.   specified, the command operates on the target window (the second
  2697.   window from the front).
  2698.  
  2699.  
  2700.                              Examples
  2701.  
  2702.   Clear §
  2703.  
  2704.   Deletes the current selection. This is like the Clear command in
  2705.   the menu bar, except that the action occurs in the target window
  2706.   rather than the active window.
  2707.  
  2708.   Clear /BEGIN/:/END/
  2709.  
  2710.   Selects everything from the next BEGIN through the following END,
  2711.   and deletes the selection.
  2712.  
  2713.  
  2714.                              See also 
  2715.  
  2716.   Cut and Replace commands.
  2717.  
  2718.   "Selections" in Chapter 6 (see Appendix B for a summary).
  2719.  
  2720. æKY Close
  2721. æC                   Close -- close specified windows
  2722.  
  2723. Close [-y | -n | -c] [ -a | window…]
  2724.  -y                  # save modified windows before closing (avoids dialog)
  2725.  -n                  # don't save any modified windows (avoids dialog)
  2726.  -c                  # cancel if there is a modified window (avoids dialog)
  2727.  -a                  # close all the windows
  2728.  
  2729. Status codes returned:
  2730.   0    No errors.
  2731.   1    Syntax error 
  2732.   2    Any other error, such as "Window not found."
  2733.   4    Cancelled from dialog.
  2734.  
  2735.                            Description
  2736.  
  2737.   Close the window or windows specified by window. If no window is
  2738.   specified, the target window is closed. If changes to the window
  2739.   have not been saved, a dialog box requests confirmation of the Close
  2740.   command. In scripts you can use the -y, -n, or -c option to avoid
  2741.   this interaction. Use the -a option instead of window to close all
  2742.   of the open windows (other than the Worksheet).
  2743.  
  2744.  
  2745.                              Examples
  2746.  
  2747.   Close
  2748.  
  2749.   Closes the target window, prompting the user with a confirmation
  2750.   dialog box if needed.
  2751.  
  2752.   Close -a -y
  2753.  
  2754.   Saves and closes all open windows.
  2755.  
  2756.   Close -n Test.a Test.r
  2757.  
  2758.   Closes the windows Test.a and Test.r without saving any of the changes.
  2759.  
  2760.  
  2761.                              See also 
  2762.  
  2763.   "File Menu" in Chapter 3.
  2764.       
  2765. æKY CMarker
  2766. æC          CMarker -- generate Mark commands for C and C++ function definitions
  2767.                      
  2768. CMarker [option…] [file…]
  2769.  -a[nachronisms]         # suppress anachronisms messages
  2770.  -d[efine] name[=string] # define name to the preprocessor (same as #define)
  2771.      [,name[=string]]… 
  2772.  -e                      # show macro expansion in the listing (default with -ppout)
  2773.  -ext[ensions] on|off    # turn on or off Apple compiler extensions (default on)
  2774.  -errors                 # suppress marking if errors are detected
  2775.  -i[ncludes] pathname    # search for include files in the specified directories (Max of 15)
  2776.      [,pathname],… 
  2777.  -lang[uage] C|"C++"     # specify target sources as either C or C++ (Default is C)
  2778.  -linesize n             # maximum number of characters generated in a single listing line
  2779.  -l[ist[ing]]            # generate a listing of the source to stdout
  2780.  -mc68881                # define the macro name mc68881 as having the value 1
  2781.  -msi                    # mark include (header) files
  2782.  -pp                     # preprocessing only (no markers will be generated)
  2783.  -ppout filename         # write the preprocessor output to the specified filename
  2784.  -p[rogress]             # write version, progress and summary information to stderr
  2785.  -showskipped            # show lines skipped by conditional compilation in the listing output
  2786.  -t                      # display processing time and number of lines to stderr
  2787.  -u[ndefine] name        # undefine the preprocessor symbol name  (same as #undef)
  2788.     [,name]…
  2789.  
  2790. Status codes returned:
  2791.    0   No errors.
  2792.    1   Parameter or option error.
  2793.    2   Execution error.
  2794.    3   Syntax errors.
  2795.    
  2796.                            Description
  2797.  
  2798. CMarker reads the specified C++/ANSI C source file(s), syntax checks them and 
  2799. generates appropriate "Open" and "Mark" MPW commands, which, when executed, 
  2800. will mark the source file(s) at each function definition with the marker name being the 
  2801. name of the function.  It's purpose is to aid in the marking of source files for use with 
  2802. the MPW "marker browser" capability.  CMarker contains a full ANSI C preprocessor 
  2803. and provides options to mark include files, generate source listings (with or without 
  2804. showing macro expansions), run the preprocessor only, flag anachronisms, and syntax 
  2805. check C++/ANSI C with or without Apple extensions.  CMarker runs as an MPW Tool. 
  2806.  
  2807. æKY Commando
  2808. æC          Commando -- present a dialog interface for commands
  2809.  
  2810. Commando [command] [-modify]
  2811.     -modify                 # enable Commando’s built-in editor
  2812.  
  2813. Status codes returned:
  2814.   0    The Do It button was selected.
  2815.   1    The Cancel button was selected.
  2816.   2    Error occurred while parsing the cmdo resource.
  2817.   3    I/O or program error.
  2818.  
  2819.                            Description
  2820.  
  2821.   The Commando interface lets you operate any properly configured MPW
  2822.   tool or script using specialized Macintosh dialog boxes instead of
  2823.   the ordinary command line method. The dialogs make it easy to find
  2824.   options and build up complex command lines.
  2825.  
  2826.   Commands with many options and parameters may employ one or more
  2827.   nested dialog boxes. See "Commando Dialogs" in Chapter 4 of the MPW manual
  2828.   for more information on the basics of using the Commando dialogs. Chapter
  2829.   13 describes the structure of the Commando resource and shows how
  2830.   to create Commando dialogs for your own tools and scripts.
  2831.  
  2832.   The controls of a Commando dialog box, including text fields, buttons,
  2833.   titles, and so on, can be sized and moved within the dialog box by
  2834.   using the mouse, exactly as you would drag an object in the Finder.
  2835.   See "Editing Commando Dialogs" in Chapter 13 for information on moving
  2836.   and sizing controls.
  2837.  
  2838.  
  2839.                              Examples
  2840.  
  2841.   Commando Rez
  2842.  
  2843.   Displays the frontmost Rez dialog box shown under "Rez" in Part II.
  2844.  
  2845.   Rez…
  2846.  
  2847.   Displays the frontmost Rez dialog box shown under "Rez" in Part II,
  2848.   exactly as in the previous example.
  2849.  
  2850.  
  2851.                              See also 
  2852.  
  2853.   "Invoking Commando" in Chapter 4.
  2854.  
  2855.   Chapter 13.
  2856.  
  2857. æKY Compare
  2858. æC                    Compare -- compare text files
  2859.  
  2860. Compare [option…] file1 [file2]  < file2 > differences ≥ progress
  2861.  -b                      # treat several blanks or tabs as a single blank
  2862.  -c c1-c2[,c1-c2]        # compare only specified columns
  2863.  -d depth                # maximum stack depth
  2864.  -e context              # display specified number of context lines
  2865.  -g groupingFactor       # grouping factor (matching lines for resync)
  2866.  -h width                # write differences horizontally
  2867.  -l                      # lower case (i.e. ignore case differences)
  2868.  -m                      # suppress displays of mismatched lines 
  2869.  -n                      # don't write to output if files match
  2870.  -p                      # write progress information to diagnostics
  2871.  -s                      # use static grouping factor
  2872.  -t                      # ignore trailing blanks
  2873.  -v                      # suppress line numbers in vertical displays
  2874.  -x                      # don't expand tabs
  2875.  
  2876. Status codes returned:
  2877.   0    Files match.
  2878.   1    Parameter or option error.
  2879.   2    Files don’t match.
  2880.  
  2881.                            Description
  2882.  
  2883.   Compares the lines of two text files and writes their differences
  2884.   to standard output. Options are provided to compare a specific column
  2885.   range in each file
  2886.  
  2887.   (-c), to ignore blanks (-b), and to ignore case (-l).
  2888.  
  2889.   Both files are read and compared line for line. As soon as a mismatch
  2890.   is found, the two mismatched lines are stored in two stacks, one
  2891.   for each file. Lines are then read alternately (starting from the
  2892.   next input line in file2 ) until a match is found to put the files
  2893.   back in synchronization. If such a match is found, Compare writes
  2894.   the mismatched lines to standard output.
  2895.  
  2896.   Files are considered resynchronized when a certain number of lines
  2897.   in the two stacks exactly match. By default, the number of lines,
  2898.   called the grouping factor, is defined by the formula
  2899.  
  2900.   G = Trunc((2.0 * Log10(M)) + 2.0)
  2901.  
  2902.   where G is the grouping factor and M is the number of lines saved
  2903.   in each stack so far. This definition requires more lines to be the
  2904.   same after larger mismatches. Using this formula, the following table shows
  2905.   the grouping factor G as a function of the number of mismatched lines:
  2906.  
  2907.   M: Number of G: Grouping
  2908.  
  2909.   mismatched lines factor
  2910.  
  2911.   1 to 3 2
  2912.  
  2913.   4 to 9 3
  2914.  
  2915.   10 to 31 4
  2916.  
  2917.   32 to 99 5
  2918.  
  2919.   100 to 315 6
  2920.  
  2921.   316 to 999 7
  2922.  
  2923.   1000 to 3161 8
  2924.  
  2925.   3162 to 9999 9
  2926.  
  2927.   With the default dynamic grouping, the -g option sets the lower limit
  2928.   for G (which must be at least 2, because the formula is always applied).
  2929.   The -s option lets you fix G as a static constant. A static G may
  2930.   be desirable under some circumstances, but may also resynchronize
  2931.   the files at undesirable points, especially if G is too small. It’s
  2932.   recommended that you use the default (dynamic G ) first; if the results
  2933.   aren’t satisfactory, try a higher minimum value of dynamic G (such
  2934.   as 3 or 4). If that is still unsatisfactory, try the static G option.
  2935.  
  2936.   With either option, there’s a limit on the depth of the stacks— that
  2937.   is, on how far out of synchronization the two files can get before
  2938.   they’re no longer worth comparing. For a dynamic G, the limit on
  2939.   the number of mismatched lines is 1000, but you can choose a lower
  2940.   limit with the -d option. For the static G option, typical values
  2941.   for G are 1 to 5, and the stack depth should be between about 10
  2942.   and 50 (the default limit is 25).
  2943.  
  2944.  
  2945.                              Examples
  2946.  
  2947.   Compare File File.bak > Mismatches
  2948.  
  2949.   Compares File and File.bak, writing the results to the file Mismatches.
  2950.   No options are specified, so dynamic grouping is used, blanks are
  2951.   retained, tabs are expanded into spaces, and matching is case sensitive.
  2952.  
  2953.   Compare File.old.§ File.new.§
  2954.  
  2955.   Compares the selected portions of the two windows and writes out
  2956.   the results.
  2957.  
  2958.   Limitations Compare can handle text files with a maximum line length
  2959.   of 255 characters.
  2960.  
  2961.   The text files compared should be fewer than 9999 lines long, because
  2962.   the displays are formatted based on four-digit line numbers.
  2963.  
  2964.  
  2965.                              See also 
  2966.  
  2967.   Equal command (Equal is a quicker command that tells you whether
  2968.   files are different, but stops at the first byte at which they differ).
  2969.  
  2970. æKY CompareFiles
  2971. æC  CompareFiles -- compare text files and interactively view differences
  2972.  
  2973. CompareFiles [-9 | -13 | -b x y | -Portrait | -TwoPage] oldFile newFile
  2974.  -9                      # assume a screen size of 512 x 342
  2975.  -13                     # assume a screen size of 640 x 480
  2976.  -b x y                  # tile windows into the rectangle specified by x y
  2977.  -Portrait               # screen size for Apple Macintosh Portrait Display
  2978.  -TwoPage                # screen size for Apple Two-Page Monochrome Monitor
  2979.  
  2980. Status codes returned:
  2981.   0    The files match.
  2982.   1    Syntax error.
  2983.   2    The files differ.
  2984.  
  2985.                            Description
  2986.  
  2987.   CompareFiles compares two text files (using the tool Compare) and,
  2988.   if there are any differences, displays the file in adjacent windows
  2989.   for interactively viewing the differences. A menu will be appended
  2990.   to the menu bar to go through the changes.
  2991.  
  2992.   When all the changes have been shown, the windows will be closed
  2993.   (if they were closed when CompareFiles started) and the menu will
  2994.   be deleted.
  2995.  
  2996.   The Compare menu contains four items for viewing and editing the
  2997.   differences. The items perform the following actions:
  2998.  
  2999.   Find Next Change Finds the next difference and highlights the changes
  3000.   in each window. (Notice that the differences are shown from bottom
  3001.   to top. This is so editing changes will not affect the file offsets
  3002.   recorded from the Compare tool.)
  3003.  
  3004.   Copy Selection »» Replaces the changed text in the new file with
  3005.   the old text.
  3006.  
  3007.   Copy Selection «« Replaces the old text with the changed text from
  3008.   the new file.
  3009.  
  3010.   Done Closes the files (asking if you want to save changes) and deletes
  3011.   the Compare menu. Use this item to close all the windows and delete
  3012.   the menu. (If you close any of the windows yourself, they will not
  3013.   be restored to their previous size and position.)
  3014.  
  3015.   The figure below shows the CompareFiles menu.
  3016.  
  3017.  
  3018.  
  3019.  
  3020.                              Examples
  3021.  
  3022.   CompareFiles Sample.old Sample.c
  3023.  
  3024.   Compares the file Sample.c to Sample.old. If there are some differences,
  3025.   those two files are opened side by side on the screen.
  3026.  
  3027.   CompareFiles -b 1024 1024 Sample.old Sample.c
  3028.  
  3029.   Compares the file Sample.c to Sample.old. If there are differences,
  3030.   the files are opened and tiled into a 1024 by 1024 rectangle.
  3031.  
  3032.  
  3033.                              See also 
  3034.  
  3035.   Compare Tool.
  3036.  
  3037. æKY CompareRevisions
  3038. æC   CompareRevisions -- compare two revisions of a file in a project
  3039. CompareRevisions file…
  3040.  
  3041. Status codes returned:
  3042.   0    No Errors.
  3043.   1    Syntax Error.
  3044.   2    Error in Processing.
  3045.   3    System Error.
  3046.  
  3047.                            Description
  3048.  
  3049.   Compare the revision of the HFS file file with another revision of
  3050.   that same file.
  3051.  
  3052.   CompareRevisions uses the ProjectInfo command to determine what project
  3053.   file belongs to and what its revision is. CompareRevisions then displays
  3054.   a list of the other revisions of the file for the user to choose.
  3055.   CompareRevisions checks this other revision out and calls the CompareFiles
  3056.   script to display both revisions on the screen and to highlight the
  3057.   differences between them. CompareFiles puts up an AddMenu named Compare
  3058.   to help you step through the differences between the two revisions.
  3059.  
  3060.   The file must belong to a currently mounted project. If the project
  3061.   that the file belongs to is not currently mounted, CompareRevisions
  3062.   displays an Alert.
  3063.  
  3064.   CompareRevisions uses the CompareFiles script.
  3065.  
  3066.  
  3067.                              Examples
  3068.  
  3069.   CompareRevisions file.c
  3070.  
  3071.   This example compares the revision in HFS file "file.c" in the working
  3072.   directory with any other revisions of file.c in the project.
  3073.  
  3074.   AddMenu Project 'Compare Revisions' 'CompareRevisions {Active} ∑∑ {WorkSheet}'
  3075.  
  3076.   This example adds CompareRevisions to the Project menu and allows
  3077.   you to compare revisions by opening the file you wish to compare
  3078.   and then selecting the 'Compare Revisions' menu item in the Project
  3079.   menu.
  3080.  
  3081.  
  3082.                              See also 
  3083.  
  3084.   CompareFiles.
  3085.  
  3086. æKY Confirm
  3087. æC             Confirm -- display a confirmation dialog box
  3088.  
  3089. Confirm [-t] [message…] < file
  3090.  -t                      # three buttons (Yes, No, Cancel)
  3091.  
  3092. Status codes returned:
  3093.   0    The OK button was selected.
  3094.   1    Syntax error.
  3095.   4    The Cancel button was selected or the No button was clicked in a three-way    dialog box.
  3096.   5    The Cancel button was selected in a three-way dialog box; see the -t option.
  3097.  
  3098.                            Description
  3099.  
  3100.   Confirm displays a confirmation dialog box with OK and Cancel buttons
  3101.   and the prompt message. There is no output to this command: the result
  3102.   of the dialog is returned in the {Status} variable.
  3103.  
  3104.   Note: Because Confirm returns a nonzero status value to indicate
  3105.   that No or Cancel was selected, a script should set the Shell variable
  3106.   {Exit} to zero before executing the Confirm command. (This step is
  3107.   necessary because the Shell aborts script processing when a nonzero
  3108.   status value is returned and {Exit} is nonzero.)
  3109.  
  3110.  
  3111.                              Examples
  3112.  
  3113.   Set Exit 0
  3114.   Confirm "Replace files with the same name? "
  3115.   If {Status} == 0
  3116.     Duplicate -y Source:≈ Destination:
  3117.   End
  3118.   Set Exit 1
  3119.  
  3120.   The following confirmation dialog box will be displayed:
  3121.  
  3122. æKY Continue
  3123. æC        Continue -- continue with next iteration of For or Loop
  3124.  
  3125. Continue [If expression]
  3126. Status codes returned:
  3127.    0   No errors.
  3128.   –3   Error in parameters, or Continue not within For…End or Loop…End.
  3129.   –5   Invalid expression.
  3130.  
  3131.                            Description
  3132.  
  3133.   If expression is nonzero, Continue terminates this iteration of the
  3134.   immediately enclosing For or Loop command and continues with the
  3135.   next iteration. (Null strings evaluate to zero.) If the "If expression"
  3136.   clause is omitted, the Continue is unconditional. If no further iterations
  3137.   are possible, the For or Loop is terminated. (For a definition of
  3138.   expression, see the Evaluate command.)
  3139.  
  3140.  
  3141.                              Examples
  3142.  
  3143.   Set Exit 0
  3144.   Set list ""
  3145.   For file In `files -t TEXT`
  3146.     Confirm -t "Print file {file}?"
  3147.     Set SaveStatus {Status}
  3148.     Continue If {SaveStatus} == 4 # No
  3149.     Break If {SaveStatus} == 5 # Cancel
  3150.     Set list "{list} '{file}'" # YesEnd
  3151.   End
  3152.   Print {PrintOptions} {list}
  3153.   Set Exit 1
  3154.  
  3155.   In this example, the Continue command is executed if the user selects
  3156.   No (status value 4). The Continue causes the current file to be skipped, but
  3157.   processing continues with the next file in the list.
  3158.  
  3159.   (For a full explanation of this example, refer to the Confirm command.)
  3160.  
  3161.  
  3162.                              See also 
  3163.  
  3164.   For, Loop, Break, and If commands.
  3165.  
  3166.   Evaluate command, for a description of expressions.
  3167.  
  3168.   "Structured Commands" in Chapter 5.
  3169.  
  3170. æKY Copy
  3171. æC                  Copy -- copy selection to Clipboard
  3172.  
  3173. Copy [-c count] selection [window]
  3174.  -c count                # copy the nth selection, where n = count
  3175.  
  3176. Status codes returned:
  3177.   0    At least one instance of the selection was found.
  3178.   1    Syntax error.
  3179.   2    Any other error.
  3180.  
  3181.                            Description
  3182.  
  3183.   Finds selection in the specified window and copies it to the Clipboard,
  3184.   replacing the previous contents of the Clipboard. If no window is
  3185.   specified, the command operates on the target window (the second
  3186.   window from the front). It’s an error to specify a window that doesn’t
  3187.   exist.
  3188.  
  3189.   For a definition of selection, see "Selections" in Chapter 6 of the MPW
  3190.   manual; a summary
  3191.   of the selection syntax is contained in Appendix B.
  3192.  
  3193.     • Note: To copy files, use the Duplicate command.
  3194.  
  3195.  
  3196.                              Examples
  3197.  
  3198.   Copy §
  3199.  
  3200.   Copies the current selection to the Clipboard. This command is like
  3201.   the Copy command in the Edit menu, except that the action takes place
  3202.   in the target window.
  3203.  
  3204.   Copy /BEGIN/:/END/
  3205.  
  3206.   Selects everything from the next BEGIN through the following END
  3207.   and copies this selection to the Clipboard.
  3208.  
  3209.  
  3210.                              See also 
  3211.  
  3212.   Cut and Paste commands.
  3213.  
  3214.   "Selections" in Chapter 6 and Appendix B.
  3215.  
  3216.  
  3217. æKY Count
  3218. æC                  Count -- count lines and characters
  3219.  
  3220. Count [-l] [-c] [file…]  < file > counts
  3221.  -l                      # write only line counts
  3222.  -c                      # write only character counts
  3223.  
  3224. Status codes returned:
  3225.   0    No errors.
  3226.   1    Error in parameters.
  3227.   2    Unable to open input file.
  3228.  
  3229.                            Description
  3230.  
  3231.   Counts the lines and characters in its input and writes the results
  3232.   to standard output. If no files are specified, standard input is
  3233.   read. If more than one file is specified, separate counts are printed
  3234.   for each file, one per line and preceded by the filename. A total
  3235.   is printed following the list.
  3236.  
  3237.  
  3238.                              Examples
  3239.  
  3240.   Count MakeFile.c Count.c
  3241.  
  3242.   Displays line counts and character counts in the form
  3243.  
  3244.   MakeFile.c 43 981
  3245.   Count.c 153 3327
  3246.   Total 196 4303
  3247.  
  3248.   Files | Count -l
  3249.  
  3250.   Displays the total number of files and directories in the current
  3251.   directory.
  3252.  
  3253.   Count -l §
  3254.  
  3255.   Displays the number of lines selected in the target window.
  3256.  
  3257.     • Note: The source code for Count is included in the CExamples
  3258.     folder in the file Count.c, as part of MPW C.
  3259.  
  3260. æKY CPlus
  3261. æC                CPlus -- script to compile C++ source
  3262.  
  3263. CPlus [option…] [file…] < file > intermediate output ≥ progress
  3264.     -a                      # force ANSI-style intermediate C code (default)
  3265.     -a0                     # force K&R-style (pre-ANSI) intermediate C code
  3266.     -a1                     # force ANSI-style intermediate C code (default)
  3267.     -b                      # put string constants into code and generate PC-relative references
  3268.     -b2                     # implies '-b' above, and allows string constants to be overlaid
  3269.     -b3                     # overlaid string constants in code (but not PC-relative refs.)
  3270.     -c                      # intermediate code to standard output; no object file
  3271.     -d name                 # equivalent to: #define name 1
  3272.     -d name=string          # equivalent to: #define name string
  3273.     -e                      # write preprocessor results to output
  3274.     -e2                     # implies '-e' above, and strips comments
  3275.     -elems881               # generate MC68881 code for transcendentals
  3276.     -f filename             # act as if input comes from named file when it actually is from stdin 
  3277.     -f1                     # send text version of C code to C compiler (no token stream)
  3278.     -i directory            # search for includes in directory
  3279.     -m                      # generate 32-bit references for data (less efficient code)
  3280.     -mbg ch8                # MPW 2.0 compatible macsbug symbols
  3281.     -mbg off                # no macsbug symbols in the code (link/unlk only if necessary)
  3282.     -mbg on|full            # full macsbug symbols
  3283.     -mbg <n>                # macsbug symbols to length <n> (<n> can be 0..63)
  3284.     -mc68020                # generate MC68020 code 
  3285.     -mc68881                # generate MC68881 code for arithmetic operations
  3286.     -mtbl0                  # suppress output of method tables for Object Pascal Classes
  3287.     -mtbl1                  # force output of method tables for Object Pascal Classes
  3288.     -n                      # Turn pointer assignment incompatibilty errors into warnings
  3289.     -o objname              # generate code in file or directory objname
  3290.     -p                      # write progress information to diagnostic
  3291.     -s segment              # generate code in segment
  3292.     -sym off                # no SADE records
  3293.     -sym on|full            # full SADE records; can modify with [,nolines] [,notypes] [,novars]
  3294.     -t                      # write C compilation time to diagnostic
  3295.     -u name                 # equivalent to: #undef name
  3296.     -vtbl0                  # suppress output of virtual tables for ordinary class
  3297.     -vtbl1                  # force output of virtual tables for ordinary class
  3298.     -vtbl2                  # new improved output algorithm for virtual tables
  3299.     -w                      # suppress warnings
  3300.     -w1                     # generate additional warnings from CFront
  3301.     -w3                     # passed through to C compiler (supresses unused warnings)
  3302.     -y directory            # create temporary files in directory
  3303.     -z0                     # force 'inline' functions to be non-inline
  3304.     -z3                     # supress name encoding of local vars and struct members (default)
  3305.     -z4                     # encode names of local vars and struct members
  3306.     -z6                     # force enums always to be int variables
  3307.     -z7                     # relax requirement on static class member initialization 
  3308.  
  3309. Status codes returned:
  3310.   0    Successful completion.
  3311.   1    Errors occurred.
  3312.  
  3313.                            Description
  3314.  
  3315.   CPlus compiles the specified C++ source file. Compiling file Name.cp
  3316.   creates object file Name.cp.o. (By convention, C++ source filenames
  3317.   end in a ".cp" suffix.) If no filenames are specified, standard input
  3318.   is compiled and the object file "c.o" is created.
  3319.  
  3320.   (Note that SADE object file information cannot be generated for standard
  3321.   input source files.)
  3322.  
  3323.   The CPlus script activates, in turn, CFront, and the MPW C Compiler.
  3324.   (CFront consists of two components: a C preprocessor and a C++ to
  3325.   C translator.)
  3326.  
  3327.   See the MPW 3.0 C++ Reference Manual for details of the MPW C++ language
  3328.   definition.
  3329.  
  3330.  
  3331.                              Examples
  3332.  
  3333.   cplus -p Sample.c
  3334.  
  3335.   Compiles Sample.c, producing the object file Sample.c.o. Writes progress
  3336.   information to diagnostic output. (Sample.c is found in Examples:CPlusExamples.)
  3337.  
  3338.  
  3339.                              See also 
  3340.  
  3341.   MPW 3.0 C Reference, MPW C++ Reference.
  3342.  
  3343. æKY CreateMake
  3344. æC                CreateMake -- create a simple makefile
  3345.  
  3346. CreateMake ([ -Application] [ -c creator ] [-sym on] | -Tool [-sym on] | 
  3347.                 -DA | -CR -m mainEntryPoint -rt resourceType [ -t fileType ] 
  3348.                 [ -c creator ] [-sym on] | -SIOW [ -sym on ]) 
  3349.                 [ -mc68020 | -mc68881 | -elems881] program file…
  3350.     -Application        # create an Application (default)
  3351.     -c creator          # optional Creator for Application or Code Resource
  3352.     -Tool               # create a Tool
  3353.     -DA                 # create a Desk Accessory
  3354.     -CR                 # create a Code Resource
  3355.     -SIOW               # create a Simple Input/Output Window
  3356.     -m mainEntryPoint   # required Main Entry Point for Code Resource
  3357.     -rt resourceType    # required Resource Type for Code Resource
  3358.     -t type             # optional File Type for Code Resource
  3359.     -sym on             # include SADE information in the object file
  3360.     -mc68020            # generate 68020 instructions
  3361.     -mc68881            # generate 68881 instructions for elementary operations
  3362.     -elems881           # generate 68881 instructions for transcendental functions
  3363.  
  3364. Status codes returned:
  3365.   0    Successful completion.
  3366.   1    Parameter or option error.
  3367.  
  3368.                            Description
  3369.  
  3370.   CreateMake creates a simple makefile for building the specified program.
  3371.   The parameter program is the name of the program. Makefile program.make
  3372.   is created. The list of files includes both source and library files.
  3373.   Source files may be written in any combination of assembly language
  3374.   (suffix ".a"), C (".c"), C++ (".cp"), Pascal (".p"), and/or Rez (".r").
  3375.  
  3376.   You can also specify Library files (suffix ".o"). Link the program
  3377.   with these files. CreateMake automatically links with the library
  3378.   files listed below. It is not necessary to specify these files as
  3379.   parameters to CreateMake.
  3380.  
  3381.   You can create Makefiles for building applications (the default),
  3382.   desk accessories, and tools.
  3383.  
  3384.   CreateMake generates commands that link the program with the following
  3385.   set of MPW libraries:
  3386.  
  3387.     • Inside Macintosh Interfaces
  3388.         {Libraries}Interface.o
  3389.     • Runtime support—one of the following:
  3390.         {Libraries}Stubs.o # a tool is to be built
  3391.         {Libraries}Runtime.o # no C object files
  3392.         {CLibraries}CRuntime.o # any C object files
  3393.     • C Libraries—if any source is in C
  3394.         {CLibraries}StdCLib.o
  3395.         {CLibraries}CSANELib.o
  3396.         {CLibraries}Math.o
  3397.         {CLibraries}CInterface.o
  3398.     • C Libraries—if any source is in C++
  3399.         {CLibraries}CPlusStreams.o # a tool is to be built
  3400.         {CLibraries}CPlusStubs.o # a DA is to be built
  3401.         {CLibraries}CSANELib.o
  3402.         {CLibraries}Math.o
  3403.         {CLibraries}CInterface.o
  3404.     • Pascal Libraries—if any source is in Pascal
  3405.         {PLibraries}PasLib.o
  3406.         {PLibraries}SANELib.o
  3407.     • For tools:
  3408.         {Libraries}ToolLibs.o
  3409.     • For desk accessories:
  3410.         {Libraries}DRVRRuntime.o
  3411.  
  3412.   CreateMake does not include dependencies on include files and USES
  3413.   files in the makefile. Libraries other than those listed above are
  3414.   not included in the Link command generated by CreateMake, unless
  3415.   specified as parameters. CreateMake is used to implement the Create
  3416.   Build Commands item in the Build menu.
  3417.  
  3418.  
  3419.                              Examples
  3420.  
  3421.   CreateMake -tool count count.c count.r
  3422.  
  3423.   Creates the makefile Count.make containing commands for building
  3424.   the tool Count from the source files Count.c and Count.r. The makefile
  3425.   is similar to the following:
  3426.  
  3427.   # File: count.make
  3428.   # Target: count
  3429.   # Sources: count.c count.r
  3430.   # Created: Thursday, June 2, 1988 5:33:38 PM
  3431.  
  3432.   count.c.o ƒ count.make count.c
  3433.       C count.c
  3434.  
  3435.   count ƒƒ count.make count.r
  3436.       Rez count.r -append -o count
  3437.  
  3438.   SOURCES = count.c count.r
  3439.   OBJECTS = count.c.o
  3440.  
  3441.   count ƒƒ count.make {OBJECTS}
  3442.  
  3443.       Link -w -t MPST -c ‘MPS ’ ∂
  3444.           "{Libraries}"Stubs.o ∂
  3445.           "{CLibraries}"CRuntime.o ∂
  3446.           "{Libraries}"Interface.o ∂
  3447.           "{CLibraries}"StdCLib.o ∂
  3448.           "{CLibraries}"CSANELib.o ∂
  3449.           "{CLibraries}"Math.o ∂
  3450.           "{CLibraries}"CInterface.o ∂
  3451.           "{Libraries}"ToolLibs.o ∂
  3452.           "{OBJECTS}" ∂
  3453.           -o count
  3454.  
  3455.  
  3456.                              See also 
  3457.  
  3458.   BuildMenu and BuildProgram commands.
  3459.  
  3460.   "Building a Program: An Introduction" in Chapter 2.
  3461.  
  3462.  
  3463. æKY Cut
  3464. æC           Cut -- copy selection to Clipboard and delete it
  3465.  
  3466. Cut [-c count] selection [window]
  3467.  -c count                # cut the next count selections
  3468.  
  3469. Status codes returned:
  3470.   0    At least one instance of the selection was found.
  3471.   1    Syntax error.
  3472.   2    Any other error.
  3473.  
  3474.                            Description
  3475.  
  3476.   Finds selection in the specified window, copies its contents to the
  3477.   Clipboard, and then deletes the selection. If no window is specified,
  3478.   the command operates on the target window (the second window from
  3479.   the front). It’s an error to specify a window that doesn’t exist.
  3480.  
  3481.   For a definition of selection, see "Selections" in Chapter 6 of the MPW
  3482.   manual; a summary of the selection syntax is contained in Appendix B.
  3483.  
  3484.  
  3485.                              Examples
  3486.  
  3487.   Cut §
  3488.  
  3489.   Cuts the current selection in the target window. (This is the same
  3490.   as the Cut menu item, except that it operates on the target window
  3491.   rather than the active window.)
  3492.  
  3493.   Cut /BEGIN/:/END/
  3494.  
  3495.   Selects everything from the next BEGIN through the following END,
  3496.   copies the contents of the selection to the Clipboard, and then deletes
  3497.   the selection.
  3498.  
  3499.  
  3500.                              See also 
  3501.  
  3502.   Clear, Copy, and Paste commands.
  3503.  
  3504.   "Selections" in Chapter 6 and in Appendix B.
  3505.  
  3506. æKY Date
  3507. æC                    Date -- write the date and time
  3508.  
  3509. Date ([-a | -s] [-d | -t] [-c seconds]) | [-n] > date
  3510.   -a                       # abbreviated date (e.g. Wed, Jun 18, 1986)
  3511.   -s                       # short date (e.g. 6/18/86)
  3512.   -d                       # write date only
  3513.   -t                       # write time only
  3514.   -c seconds               # write date corresponding to seconds
  3515.   -n                       # write seconds since January 1, 1904
  3516.  
  3517. Status codes returned:
  3518.   0    No error.
  3519.   1    Syntax error.
  3520.  
  3521.                            Description
  3522.  
  3523.   Writes the current date and time to standard output in a variety
  3524.   of standard and user-specified formats. Date arithmetic is supported
  3525.   with the -n and -c options that work with the number of seconds since
  3526.   January 1, 1904. With no options the Date output has this form: Thursday,
  3527.   August 30, 1988 10:45:51 A.M.
  3528.  
  3529.  
  3530.                              Examples
  3531.  
  3532.   Date
  3533.  
  3534.   returns the date in the form
  3535.   Friday, February 14, 1988 10:34:25 PM
  3536.  
  3537.   Date -a
  3538.  
  3539.   returns
  3540.   Fri, Feb 14, 1988 10:34:25 PM
  3541.  
  3542.   Date -s -d
  3543.  
  3544.   returns
  3545.   2/14/86
  3546.  
  3547.   Set starttime `Date -n`
  3548.   BuildMyProgram
  3549.   Set endTime `Date -n`
  3550.   Echo Total time for BuildMyProgram ∂
  3551.   `Evaluate {endTime} - {startTime}`
  3552.  
  3553.   This example demonstrates how date arithmetic may be used to show
  3554.   how long a tool or script takes to execute.
  3555.  
  3556. æKY Delete
  3557. æC                Delete -- delete files and directories
  3558.  
  3559. Delete [-y | -n | -c] [-i] [-p] name…  ≥ progress
  3560.  -y                # delete directory contents (avoids dialog)
  3561.  -n                # don't delete directory contents (avoids dialog)
  3562.  -c                # cancel if a directory is to be deleted (avoids dialog)
  3563.  -i                # ignore errors (no diagnostics)
  3564.  -p                # write progress information to diagnostics
  3565.   
  3566. Status codes returned:
  3567.   0    All specified objects were deleted (except for any directories skipped 
  3568.        with the -n option).
  3569.   1    Syntax error.
  3570.   2    An error occurred during the delete.
  3571.   4    Cancel was selected or implied by the -c option.
  3572.  
  3573.                            Description
  3574.  
  3575.   Deletes file or directory name. If name is a directory, name and
  3576.   its contents (including all subdirectories) are deleted.
  3577.  
  3578.   Before deleting directories, a dialog box will request confirmation
  3579.   for the deletion. Use the -y, -n, or -c options in scripts to avoid
  3580.   this interaction. Be sure to see the warning at the end of this section.
  3581.  
  3582.  
  3583.                              Examples
  3584.  
  3585.   Delete HD:MPW:≈.c
  3586.  
  3587.   Deletes all items in the MPW folder that end in ".c". (Recall that
  3588.   the Shell first replaces the parameter "≈.c" with a list of filenames
  3589.   matching the pattern—the Delete command then deletes each of these
  3590.   files.)
  3591.  
  3592.   Warning Beware of potentially disastrous typographical mistakes such
  3593.   as the following:
  3594.  
  3595.   Delete ≈ .c
  3596.  
  3597.   Note the space after "≈"—this space causes "≈" and ".c" to be treated
  3598.   as two separate parameters. In this case, Delete deletes all files
  3599.   in the current directory and also attempts to delete a file named
  3600.   ".c".
  3601.  
  3602.   Also note that the following command deletes everything:
  3603.  
  3604.   Delete ≈:
  3605.  
  3606.   That is, the filename pattern ≈: expands to the names of all volumes
  3607.   online (including the startup volume!).
  3608.  
  3609.   When deleting files en masse, it’s a good practice to use the Echo
  3610.   command to verify the action of the filename generation operators;
  3611.   for example,
  3612.  
  3613.   Echo ≈.c
  3614.  
  3615.  
  3616.                              See also 
  3617.  
  3618.   Clear command (for deleting selections).
  3619.  
  3620.   "Filename Generation" in Chapter 5.
  3621.  
  3622. æKY DeleteMenu
  3623. æC        DeleteMenu -- delete user-defined menus and menu items
  3624.  
  3625. DeleteMenu [menuName [itemName]]
  3626.  
  3627. Status codes returned:
  3628.   0    No errors.
  3629.   1    Syntax error.
  3630.   2    Other errors.
  3631.  
  3632.                            Description
  3633.  
  3634.   Deletes the user-defined item itemName in the menu menuName. If itemName
  3635.   is omitted, all user-defined items for menuName are deleted.
  3636.  
  3637.   Caution If itemName and menuName are both omitted, all user-defined
  3638.   items are deleted. Menu items that haven’t been added with AddMenu
  3639.   can’t be deleted with DeleteMenu.
  3640.  
  3641.  
  3642.                              Examples
  3643.  
  3644.   DeleteMenu File
  3645.  
  3646.   Deletes all user-defined items from the File menu.
  3647.  
  3648.  
  3649.                              See also 
  3650.  
  3651.   AddMenu command. 
  3652.  
  3653. æKY DeleteNames
  3654. æC           DeleteNames -- delete user-defined symbolic names
  3655.  
  3656. DeleteNames [-u user] [-private] [-project project] [-public] [-r] [names… | -a]
  3657.   -u user                 # name of current user
  3658.   -private                # delete private names
  3659.   -project project        # name of project that contains the files
  3660.   -public                 # delete public names
  3661.   -r                      # delete names recursively
  3662.   -a                      # delete all names
  3663.  
  3664. Status codes returned:
  3665.   0    No errors.
  3666.   1    Syntax error.
  3667.   2    Error in processing.
  3668.  
  3669.                            Description
  3670.  
  3671.   Delete symbolic names used to represent a set of revisions under
  3672.   Projector. You can create symbolic names by using the NameRevisions
  3673.   command.
  3674.  
  3675.   You can use the -log option of the ProjectInfo command to see which
  3676.   names have been deleted and what their values were.
  3677.  
  3678.   See Chapter 7 of MPW Manual for complete definitions of the terms and 
  3679.   symbols used in Projector commands.
  3680.  
  3681.  
  3682.                              Examples
  3683.  
  3684.   Suppose you have created a Name "Work" that is expanded to the
  3685.   files file.c and interactive.c using the command
  3686.  
  3687.   NameRevisions Work file.c interactive.c
  3688.  
  3689.   Then:
  3690.  
  3691.   DeleteNames Work
  3692.  
  3693.   removes "Work" from the list of symbolic names.
  3694.  
  3695.  
  3696.                              See also 
  3697.  
  3698.   NameRevisions, ProjectInfo.
  3699.  
  3700.  
  3701. æKY DeletePane
  3702. æC                          DeletePane --  delete panes from the window
  3703.  
  3704. DeletePane [-p paneSpec | -a] [window]
  3705.      -p paneSpec            # choose a  pane to delete
  3706.      -a                     # reset the window to one pane
  3707.  
  3708.       Note: paneSpec is an alternating catenation of strings of the 
  3709.       form cm and rn, where m is a column ordinal and n is a row ordinal.
  3710.  
  3711.  
  3712. æKY DeleteRevisions
  3713. æC  DeleteRevisions -- delete previous revisions of files in a project
  3714.  
  3715. DeleteRevisions [-u user] [-project project] [-file] [-y] revision…
  3716.     -u user                 # name of current user
  3717.     -project project        # name of project that contains the files
  3718.     -file                   # deletes the file and all its revisions
  3719.     -y                      # delete the file/revision (avoids dialog)
  3720.  
  3721. Status codes returned:
  3722.   0    No errors.
  3723.   1    Syntax error.
  3724.   2    Error in processing.
  3725.   3    System error.
  3726.  
  3727.                            Description
  3728.  
  3729.   Delete old revisions by specifying the oldest revision that you want
  3730.   to keep. All prior revisions are deleted. Delete all revisions on
  3731.   a branch by naming the branch or branches in the named files under
  3732.   Projector. It is an error to try to delete a revision that is currently
  3733.   checked out for modification.
  3734.  
  3735.   Revision is either a filename, a filename followed by a comma and
  3736.   a revision number, or a filename followed by a comma and a branch
  3737.   name (such as
  3738.  
  3739.   foo.c,22a).
  3740.  
  3741.   You can use the -file option to remove the file and all of its revisions
  3742.   from the project.
  3743.  
  3744.   s Warning DeleteRevisions permanently removes the revisions and branches
  3745.   specified. They cannot be recovered.  s
  3746.  
  3747.   You can use the -log option of the ProjectInfo command to see which
  3748.   revisions have been deleted and who deleted them.
  3749.  
  3750.   See Chapter 7 of the MPW Manual for complete definitions of the terms and 
  3751.   symbols used in Projector commands.
  3752.  
  3753.  
  3754.                              Examples
  3755.  
  3756.   DeleteRevisions -project Zoom∫Utilities∫MyProject file.c
  3757.  
  3758.   This example deletes all revisions except the latest in file.c in
  3759.   the named project.
  3760.  
  3761.   DeleteRevisions file.c,22a3
  3762.  
  3763.   This example deletes all revisions on branch 22a before revision
  3764.   3 of file.c.
  3765.  
  3766.   DeleteRevisions file.c,22a
  3767.  
  3768.   This command deletes all the revisions on branch 22a in file.c of
  3769.   the current project.
  3770.  
  3771.   DeleteRevisions -file file.c
  3772.  
  3773.   This command deletes the file file.c and all of its revisions from
  3774.   the current project.
  3775.  
  3776.  
  3777.                              See also 
  3778.  
  3779.   NameRevisions, ProjectInfo.
  3780.  
  3781. æKY DeRez
  3782. æC                     DeRez -- resource decompiler
  3783.  
  3784. DeRez [option…] resourceFile [file…]  > description ≥ progress
  3785.     -c[ompatible]           # generate output compatible with Rez 1.0
  3786.     -e[scape]               # don't escape chars < $20 or > $D8
  3787.     -d[efine] name[=value]  # equivalent to #define name [value]
  3788.     -i[nclude] pathname     # search this path when looking for #include files
  3789.     -m[axstringsize] n      # write strings n characters per line
  3790.     -only typeExpr          # process only resources of this type
  3791.     -p[rogress]             # write progress information to diagnostics
  3792.     -rd                     # suppress warnings for redeclared types
  3793.     -s[kip] typeExpr        # skip resources of this type
  3794.     -u[ndef] name           # equivalent to #undef name
  3795.  
  3796.     Note: A typeExpr may have one of these forms:
  3797.           type
  3798.         "'type'(id)"
  3799.         "'type'(id:id)"
  3800.         "'type'(∂"name∂")"
  3801.  
  3802. Status codes returned:
  3803.   0    No errors.
  3804.   1    Error in parameters.
  3805.   2    Syntax error in file.
  3806.   3    I/O or program error.
  3807.  
  3808.                            Description
  3809.  
  3810.   Creates a text representation (resource description) of the resource
  3811.   fork of resourceFile, according to the resource type declarations
  3812.   in the resource description file(s). The resource description is
  3813.   written to standard output.
  3814.  
  3815.   A resource description file is a file of type declarations in the
  3816.   format used by the resource compiler, Rez. The type declarations
  3817.   for standard Macintosh resources are contained in the files Types.r
  3818.   and SysTypes.r, contained in the {RIncludes} folder. If no resource
  3819.   description file is specified, the output consists of data statements
  3820.   giving the resource data in hexadecimal form, without any additional
  3821.   format information.
  3822.  
  3823.   If the output of DeRez is used as input to Rez, with the same resource
  3824.   description files, it produces the same resource fork that was originally
  3825.   input to DeRez. DeRez is not guaranteed to be able to run a declaration
  3826.   backwards; if it can’t, it produces a data statement instead of the
  3827.   appropriate resource statement.
  3828.  
  3829.   DeRez ignores all include (but not #include), read, data, change,
  3830.   delete, and resource statements found in the resourceDescriptionFile.
  3831.   (It still parses these statements for correct syntax.)
  3832.  
  3833.   For the format of resource type declarations, see Chapter 11 and
  3834.   Appendix D of the MPW manual.
  3835.  
  3836.  
  3837.                              Examples
  3838.  
  3839.   DeRez "{ShellDirectory}MPW Shell" -only MENU Types.r
  3840.  
  3841.   Displays all of the 'MENU' resources used by the MPW Shell. The type
  3842.   definition for 'MENU' resources is found in the file Types.r.
  3843.  
  3844.   DeRez HD:OS:System SysTypes.r ∂
  3845.   -only "'DRVR' (∂"\\0x00Scrapbook∂")"
  3846.  
  3847.   Decompiles the Scrapbook desk accessory in the copy of the System
  3848.   file that’s located in directory HD:OS:. (The type definition for
  3849.   'DRVR' resources is found in the file SysTypes.r.)
  3850.  
  3851.  
  3852.                              See also 
  3853.  
  3854.   Rez and RezDet commands.
  3855.  
  3856.   Chapter 11.
  3857.  
  3858.   Type declaration files in RIncludes folder:
  3859.  
  3860.     • Types.r
  3861.  
  3862.     • SysTypes.r
  3863.  
  3864.     • MPWTypes.r
  3865.  
  3866.     • Pict.r
  3867.  
  3868. æKY Directory
  3869. æC           Directory -- set or write the default directory
  3870.  
  3871. Directory [-q | directory]   > directory
  3872.  -q                      # don't quote directories with special characters
  3873.  
  3874. Status codes returned:
  3875.   0    No error.
  3876.   1    Directory not found, command aborted, or parameter error.
  3877.  
  3878.                            Description
  3879.  
  3880.   If specified, directory becomes the new default directory. Otherwise
  3881.   the pathname of the current default directory is written to standard
  3882.   output.
  3883.  
  3884.   If directory is a leafname, the command searches for directory in
  3885.   the directories listed in the Shell variable {DirectoryPath}. If
  3886.   the variable is undefined, the command looks in the current directory.
  3887.  
  3888.     • Note: To display a directory’s contents, use the Files command.
  3889.  
  3890.  
  3891.                              Examples
  3892.  
  3893.   Directory
  3894.  
  3895.   Writes the pathname of the current directory to standard output.
  3896.  
  3897.   Directory HD:MPW:Examples:
  3898.  
  3899.   Sets the default directory to the folder Examples in the folder MPW
  3900.   on the volume HD. The final colon is optional.
  3901.  
  3902.   Directory Reports:
  3903.  
  3904.   Sets the default directory to the volume Reports. Note that volume
  3905.   names must end in a colon.
  3906.  
  3907.   Directory :Include:Pascal:
  3908.  
  3909.   Sets the default directory to the folder Pascal in the folder Include
  3910.   in the current default directory.
  3911.  
  3912.   Set DirectoryPath ":, {MPW}, {MPW}Projects:"
  3913.  
  3914.   Directory Tools
  3915.  
  3916.   Sets the directory to the Tools directory. The current directory
  3917.   is searched first, followed by the {MPW} directory, and finally by
  3918.   the {MPW} Projects directory. If there is no Tools directory in your
  3919.   current directory, the directory is set to {MPW}Tools.
  3920.  
  3921.  
  3922.                              See also 
  3923.  
  3924.   "File and Window Names" in Chapter 4.
  3925.  
  3926.   Files, NewFolder, and SetDirectory commands.
  3927.  
  3928. æKY DirectoryMenu
  3929. æC        DirectoryMenu [directory…] -- create the Directory menu
  3930.  
  3931. Status code returned:
  3932.    0    no errors always returned.
  3933.  
  3934.                            Description
  3935.  
  3936.   Creates the Directory menu shown here. The optional directory… parameter
  3937.   specifies the initial list of directories that appears in the menu.
  3938.   The menu items are described in Chapter 3 of the MPW manual.
  3939.  
  3940.   The lower section of the Directory menu contains a list of directories.
  3941.   Initially this list consists of the parameters to DirectoryMenu.
  3942.   As other directories become the current directory (using the Set
  3943.   Directory menu item or the SetDirectory command), they are added
  3944.   to the list.
  3945.  
  3946.  
  3947.                              Examples
  3948.  
  3949.   DirectoryMenu `(Files -d -i {MPW}Examples:≈) ≥ Dev:Null` `Directory`
  3950.  
  3951.   Creates the Directory menu. Directories in directory {MPW} that match
  3952.   the pattern Examples:≈ will be included in the Directory menu, along
  3953.   with the current directory.
  3954.  
  3955.   This DirectoryMenu command should be included in your UserStartup
  3956.   file to install the Directory menu. You might replace the Examples
  3957.   directories and the default directory with your favorite list of
  3958.   directories.
  3959.  
  3960. æKY DoIt
  3961. æC       DoIt -- highlight and execute a series of shell commands
  3962.  
  3963. DoIt (CommandFile [-echo] [-dump]) | [-selection]
  3964.  -echo                   # echo commands before execution
  3965.  -dump                   # dump unexecuted commands after error
  3966.  -selection              # execute command in the current selection
  3967.  
  3968. Status codes returned:
  3969.   0    No errors.
  3970.   1    Syntax error.
  3971.  
  3972.                            Description
  3973.  
  3974.   DoIt will execute a series of Shell commands, highlighting each command
  3975.   as it is executed. The commands can be either in a file or in the
  3976.   current selection of the active window. If a CommandFile is passed
  3977.   to DoIt, the file is opened (as the active window) and each command
  3978.   is executed. The window is closed when all commands have been processed.
  3979.  
  3980.   This command will not work for a series of commands that contains
  3981.   structured commands such as If statements or Loops.
  3982.  
  3983.  
  3984.                              Examples
  3985.  
  3986.   Backup -from "HD:Src:" -to "Backup:Src" -a -r -c > out
  3987.  
  3988.   DoIt out
  3989.  
  3990.   The above command will highlight and execute all the Duplicate commands
  3991.   generated by the Backup command. In this way you can see progress
  3992.   as the files are being duplicated.
  3993.  
  3994.   AddMenu DoIt "DoIt Selection" "DoIt -selection"
  3995.  
  3996.   The above AddMenu command will create a menu that can be used to
  3997.   highlight and execute the current selection. This could be used on
  3998.   a series of commands generated by Make or Backup that were written
  3999.   to the Active window. Simply select the commands and select the "DoIt
  4000.   Selection" menu item.
  4001.  
  4002.   Make > make.out
  4003.  
  4004.   DoIt -dump make.out
  4005.  
  4006.   This DoIt command will open the make.out file and highlight and execute
  4007.   each of the commands generated by the previous make command. In this
  4008.   way you can see progress as the files are being compiled and linked.
  4009.   If an error occurs (for instance, in one of the compiles), that compile
  4010.   command along with the rest of the commands in the make.out will
  4011.   be written to the WorkSheet. At this point you could fix the error
  4012.   (in the source file), select the "ToDo" marker (which would select
  4013.   the remaining commands), and select the "DoIt Selection" menu item
  4014.   to execute the remaining commands.
  4015.  
  4016. æKY DumpCode
  4017. æC              DumpCode -- write formatted CODE resources
  4018.  
  4019. DumpCode [option…] resourceFile  > dump ≥ progress
  4020.     -a                      # Show offsets from beginning of segment
  4021.     -d                      # don't dump object code
  4022.     -di                     # don't dump data initialization info
  4023.     -h                      # don't write headers (offsets, hex, etc.)
  4024.     -jt                     # don't dump jump table
  4025.     -n                      # dump only resource names
  4026.     -p                      # write progress information to diagnostics
  4027.     -r byte1[,byte2]        # dump code from address byte1 (through byte2)
  4028.     -ri                     # don't dump a5- and segment-relocation info
  4029.     -rt type[=id]           # dump only resources with this type (and id)
  4030.     -s name                 # dump only resource with this name
  4031.  
  4032. Status codes returned:
  4033.   0    No problem.
  4034.   1    Syntax error.
  4035.   2    Fatal error.
  4036.  
  4037.                            Description
  4038.  
  4039.   Disassembles object code that is stored in resources such as 'CODE',
  4040.   'DRVR', and 'PDEF'. DumpCode reads from the resource fork of the
  4041.   specified file and writes the formatted assembly code to standard
  4042.   output. The default formatting convention is to disassemble the code
  4043.   and to display the corresponding bytes in hexadecimal and ASCII.
  4044.  
  4045.   The default behavior of DumpCode is to dump all the 'CODE' resources
  4046.   from a program file. The -rt option can be used to dump resources
  4047.   of other types, such as drivers and desk accessories.
  4048.  
  4049.   Some conventions about executable code resources are built into DumpCode
  4050.   and affect the formatted output in special ways:
  4051.  
  4052.     • 'CODE' resources with ID 0 are formatted as a jump table (unloaded
  4053.     format).
  4054.  
  4055.     • Other 'CODE' resources have information about jump table entries
  4056.     in the first four bytes.
  4057.  
  4058.     • 'DRVR' resources have a special format at the beginning of
  4059.     the resource.
  4060.  
  4061.   In addition, you can direct DumpCode to give a symbolic dump of data
  4062.   initialization descriptors and initial values.
  4063.  
  4064.  
  4065.                              Examples
  4066.  
  4067.   DumpCode Sample > SampleDump
  4068.  
  4069.   Formats the 'CODE' resources in the file Sample, writing the output
  4070.   to the file SampleDump. The output has this format:
  4071.  
  4072.   File: sample, Resource 3, Type: CODE, Name: _DataInit
  4073.   Offset of first jump table entry: $00000018
  4074.   Segment is $000000D2 bytes long, and uses 1 jump table entry
  4075.   000000: 48E7 FFF0 'H...' MOVEM.L D0-D7/A0-A3,-(A7)
  4076.   000004: 4247 'BG' CLR.W D7
  4077.   000006: 4EAD 0032 'N..2' JSR $0032(A5)
  4078.   00000A: 2218 '".' MOVE.L (A0)+,D1
  4079.   etc.
  4080.  
  4081.  
  4082.                              See also 
  4083.  
  4084.   DumpObj command.
  4085.  
  4086.   "The Jump Table" in the chapter "Segment Loader" of Inside Macintosh,
  4087.   for a description of the jump table.
  4088.  
  4089.   Appendix H, "Object File Format."
  4090.  
  4091. æKY DumpFile
  4092. æC               DumpFile -- display contents of any file
  4093.  
  4094. DumpFile  [ option… ]  filename > dump ≥ progress
  4095.  -rf                # display the resource fork of the file. (Default is 
  4096.                     # data fork.)
  4097.  -bf                # display both forks of the file
  4098.  -a                 # suppress display of ASCII character values. 
  4099.  -h                 # suppress display of hexadecimal characters.
  4100.  -o                 # suppress display of file offsets.
  4101.  -w nn              # width - display nn bytes on each line of output.
  4102.  -g nn              # group nn bytes together without intervening spaces.
  4103.  -p                 # write progress information to diagnostic output.
  4104.  -r byte1[,byteN]   # display only the byte range from byte1 to byteN.
  4105.  
  4106. Status codes returned:
  4107.   0    No problem.
  4108.   1    Syntax error.
  4109.   2    Fatal error.
  4110.  
  4111.                            Description
  4112.  
  4113.   DumpFile lets you display the contents of the resource fork or data
  4114.   fork of a file in a variety of formats.
  4115.  
  4116.  
  4117.                              Examples
  4118.  
  4119.   DumpFile -p ATestFile
  4120.  
  4121.   Formats the data fork of the file ATestFile and writes its contents
  4122.   to standard output. This output has the following format:
  4123.  
  4124.   DumpFile -p ATestFile
  4125.  
  4126.   MPW File Display Utility Version 3.0B1 Release April 15,
  4127.   1988 Start: 1:24:09 PM 4/19/88
  4128.  
  4129.   Copyright Apple Computer, Inc. 1985-1988
  4130.   All Rights Reserved.
  4131.  
  4132.   File : ATestFile
  4133.   Data Fork Length : 20
  4134.   Resource Fork Length : 382
  4135.   Dumping Data Fork from offset 0 to 20
  4136.  
  4137.     0: 54 68 69 73 20 69 73 20 61 20 74 65 73 74 20 66 This.is.a.test.file.
  4138.    10: 69 6C 65 2E
  4139.   DumpFile completed normally
  4140.   Execution required 0 seconds.
  4141.  
  4142.   DumpFile -w 12 -g 4 ATestFile
  4143.  
  4144.   Formats the data fork of the file ATestFile and writes its contents
  4145.   to standard output, grouping four bytes at a time and displaying
  4146.   12 bytes per line. This output has the following format:
  4147.  
  4148.   File : ATestFile
  4149.   Data Fork Length : 20
  4150.   Resource Fork Length : 382
  4151.   Dumping Data Fork from offset 0 to 20
  4152.  
  4153.     0: 54686973 20697320 61207465 This.is.a.te
  4154.     C: 73742066 696C652E st.file.
  4155.  
  4156.   DumpFile -rf -r 0,30 -g 4 ATestFile
  4157.  
  4158.   Formats the resource fork of the file ATestFile and writes the contents
  4159.   of bytes 0 through 30 to standard output in 4-byte groups. This output
  4160.   has the following format:
  4161.  
  4162.   File : ATestFile
  4163.   Data Fork Length : 20
  4164.   Resource Fork Length : 382
  4165.   Dumping Resource Fork from offset 0 to 30
  4166.  
  4167.     0: 00000100 0000014C 0000004C 00000032 .......L...L...2
  4168.    10: 696C652E 6F727920 2227227B 646972 ile.ory."'"{dir
  4169.  
  4170. æKY DumpObj
  4171. æC                DumpObj -- write formatted object file
  4172.  
  4173. DumpObj [option…] objectFile  > dump ≥ progress
  4174.     -d                      # don't dump object code
  4175.     -h                      # don't write headers (offsets, hex, etc.)
  4176.     -i                      # use ids, rather than names, in dump
  4177.     -jn                     # just use names, rather than ids, in dump
  4178.     -l                      # dump file locations of object records
  4179.     -m name                 # dump only module "name" or module containing
  4180.                             # entry-point "name" (-m option may be used repeatedly)
  4181.     -n                      # dump only the dictionary of names
  4182.     -p                      # write progress information to diagnostics
  4183.     -r byte1[,byte2]        # dump code from byte1 in file (through byte2)
  4184.     -mh                     # omit module summary header
  4185.     -mods                   # dump a module summary with entry point information
  4186.     -sym [Off]              # disable symbolic output 
  4187.          [On | Full]        # enable symbolic output (default), can be followed by:
  4188.             [,NoLabels]     #   omit label information
  4189.             [,NoLines]      #   omit source line information
  4190.             [,NoTypes]      #   omit type information
  4191.             [,NoVars]       #   omit variable information
  4192.  
  4193. Status codes returned:
  4194.   0    No problem.
  4195.   1    Syntax error.
  4196.   2    Fatal error.
  4197.  
  4198.                            Description
  4199.  
  4200.   Disassembles object code that is stored in the data fork of an object
  4201.   file. By convention, object files end in the suffix ".o". In addition,
  4202.   the object file must have type 'OBJ'.
  4203.  
  4204.  
  4205.                              Examples
  4206.  
  4207.   DumpObj Sample.p.o >SampleDump
  4208.  
  4209.   Formats the file Sample.p.o and writes its contents to the file SampleDump.
  4210.   This output has the following format:
  4211.  
  4212.   Dump of file sample.p.o
  4213.   First: Kind 0 Version 1
  4214.   Dictionary: FirstId 2
  4215.     2: Main
  4216.  
  4217.   Pad
  4218.   Module: Flags $00 ModuleId 1 SegmentId Main
  4219.   Content: Flags $00
  4220.   Contents offset 0000 size 006A
  4221.  
  4222.   000000: 4E56 FFFE 'NV..' LINK A6,#$FFFE
  4223.   000004: 2F07 '/.' MOVE.L D7,-(A7)
  4224.   000006: 42A7 'B.' CLR.L -(A7)
  4225.   000008: 3F3C 0080 '?<..' MOVE.W #$0080,-(A7)
  4226.   etc.
  4227.  
  4228.   For more information, see Appendix H.
  4229.  
  4230.  
  4231.                              See also 
  4232.  
  4233.   DumpCode command.
  4234.  
  4235.   Appendix H, "Object File Format."
  4236.  
  4237.  
  4238. æKY Duplicate
  4239. æC             Duplicate -- duplicate files and directories
  4240.  
  4241. Duplicate [-y | -n | -c] [-p] [-d | -r] name… target  ≥ progress
  4242.  -y                      # overwrite target files (avoids dialog)
  4243.  -n                      # don't overwrite target files (avoids dialog)
  4244.  -c                      # cancel if conflict occurs (avoids dialog)
  4245.  -p                      # write progress information to diagnostics
  4246.  -d                      # duplicate data fork only
  4247.  -r                      # duplicate resource fork only
  4248.  
  4249. Status codes returned:
  4250.   0    All objects were duplicated.
  4251.   1    Syntax error.
  4252.   2    An error occurred.
  4253.   4    Cancel was selected or implied from the -c option.
  4254.  
  4255.                            Description
  4256.  
  4257.   Duplicates name to targetName. (Name and targetName are file or directory
  4258.   names.) If targetName is a file or doesn’t exist, the file or directory
  4259.   name is duplicated and named targetName. If targetName is a directory,
  4260.   the objects named are duplicated into that directory. (If more than
  4261.   one name is present, targetName must be a directory.) Created objects
  4262.   are given the same creation and modification dates as their source.
  4263.  
  4264.   If a directory is duplicated, its contents (including all subdirectories)
  4265.   are also duplicated. No directory duplicated can be a parent of targetName.
  4266.  
  4267.   Name can also be a volume; if targetName is a directory, name is
  4268.   copied into targetName.
  4269.  
  4270.   A dialog box requests a confirmation if the duplication would overwrite
  4271.   an existing file or folder. You can use the -y, -n, or -c option
  4272.   in scripts to avoid this interaction.
  4273.  
  4274.  
  4275.                              Examples
  4276.  
  4277.   Duplicate Aug86 "Monthly Reports"
  4278.  
  4279.   Assuming "Monthly Reports" is an existing directory, duplicates the
  4280.   file Aug86 into that directory.
  4281.  
  4282.   Duplicate File1 Folder1 "Backup Disk:"
  4283.  
  4284.   Duplicates File1 and Folder1 (including its contents) onto Backup
  4285.   Disk.
  4286.  
  4287.   Duplicate -y File1 File2
  4288.  
  4289.   Duplicates File1 to File2, overwriting File2 if it exists.
  4290.  
  4291.   Duplicate Disk1:≈ HD:Files:
  4292.  
  4293.   Duplicates all of the files on Disk1 into the directory HD:Files.
  4294.  
  4295.   Duplicate Disk1: HD:Files:
  4296.  
  4297.   Duplicates all of Disk1 (as a directory) into HD:Files.
  4298.  
  4299.   Limitation Duplicate doesn’t recognize folders on non-HFS disks.
  4300.  
  4301.  
  4302.                              See also 
  4303.  
  4304.   Move and Rename commands.
  4305.  
  4306.   "File and Window Names" in Chapter 4.
  4307.  
  4308.   "Filename Generation" in Chapter 5.
  4309.  
  4310. æKY Echo
  4311. æC                      Echo -- echo parameters
  4312.  
  4313. Echo [-n] [parameter…]   > parameters
  4314.  -n                      # don't write return following the parameters
  4315.  
  4316. Status codes returned:
  4317.   0    is always returned.
  4318.  
  4319.                            Description
  4320.  
  4321.   Writes its parameters, separated by spaces and terminated by a return,
  4322.   to standard output. If no parameters are specified, only a return
  4323.   is written.
  4324.  
  4325.   Echo is especially useful for checking the results of variable substitution,
  4326.   command substitution, and filename generation.
  4327.  
  4328.  
  4329.                              Examples
  4330.  
  4331.   Echo "Use Echo to write progress info from scripts."
  4332.  
  4333.   Use Echo to write progress info from scripts.
  4334.  
  4335.   The Echo command above writes the second line to standard output.
  4336.  
  4337.   Echo {Status}
  4338.  
  4339.   Writes the current value of the {Status} variable—that is, the status
  4340.   of the last command executed.
  4341.  
  4342.   Echo ≈.a
  4343.  
  4344.   Echoes the names of all files in the current directory that end with
  4345.   ".a". (This might be useful as a precaution before executing another
  4346.   command with the argument "≈.a".)
  4347.  
  4348.   Echo -n > EmptyFile
  4349.  
  4350.   If EmptyFile exists, this command deletes its contents; if the file
  4351.   doesn’t exist, it is created.
  4352.  
  4353.  
  4354.                              See also 
  4355.  
  4356.   Parameters and Quote commands.
  4357.  
  4358. æKY Eject
  4359. æC                       Eject -- eject volumes
  4360.  
  4361. Eject [-m] volume…
  4362.  -m                      # leave the volume mounted
  4363.  
  4364. Status codes returned:
  4365.   0    The disk was successfully ejected.
  4366.   1    Syntax error.
  4367.   2    An error occurred.
  4368.  
  4369.                            Description
  4370.  
  4371.   Flushes the volume, unmounts it, and then ejects it, if it is a 3.5-inch
  4372.   disk. A volume name must end with a colon ( : ). If volume is a number
  4373.   without a colon, it’s interpreted as a drive number.
  4374.  
  4375.     • Note: If you unmount the current volume (the volume containing
  4376.     the current directory), the boot volume becomes the current volume.
  4377.     You can keep the volume mounted with the -m option. (See the
  4378.     chapter "File Manager" of Inside Macintosh.)
  4379.  
  4380.  
  4381.                              Examples
  4382.  
  4383.   Eject Memos:
  4384.  
  4385.   Ejects (and unmounts) the disk titled Memos.
  4386.  
  4387.   Eject 1
  4388.  
  4389.   Ejects and unmounts the disk in drive 1 (the internal drive).
  4390.  
  4391.  
  4392.                              See also 
  4393.  
  4394.   Mount, Unmount, and Volumes commands.
  4395.  
  4396. æKY Entab
  4397. æC                Entab -- convert runs of spaces to tabs
  4398.  
  4399. Entab [option…] [file…]  < file > tabbed ≥ progress
  4400.  -a minValue             # Min run of blanks that can be replaced with a tab
  4401.  -d tabValue             # input tab setting
  4402.  -l quote…               # left quotes that prevent EnTab (default '")
  4403.  -n                      # no quote characters, EnTab everything
  4404.  -p                      # write progress information to diagnostics
  4405.  -q quote…               # quotes that prevent EnTab (default '")
  4406.  -r quote…               # right quotes that prevent EnTab (default '")
  4407.  -t tabValue             # output tab setting
  4408.  
  4409. Status codes returned:
  4410.   0    Normal termination.
  4411.   1    Parameter or option error.
  4412.  
  4413.                            Description
  4414.  
  4415.   Copies the specified text files to standard output, replacing runs
  4416.   of spaces with tabs. The default behavior of Entab is to do the following:
  4417.  
  4418.   1. Detab the input file, using the file’s tab setting (a resource
  4419.   saved with the file by the Shell editor), or 4 if there is none.
  4420.   You can override this "detab" value with the -d option.
  4421.  
  4422.   2. Entab the file, setting tab stops every 4 spaces. You can specify
  4423.   another tab setting with the -t option. The entabbed output file
  4424.   looks the same as the original file(s), but contains fewer characters.
  4425.  
  4426.   Options are also provided for controlling the processing of blanks
  4427.   between quoted strings.
  4428.  
  4429.  
  4430.                              Examples
  4431.  
  4432.   Entab -t 2 Example.p > CleanExample.p
  4433.  
  4434.   Detabs the file Example.p (using the file’s default tab setting),
  4435.   re-entabs it with a tab setting of 2, and writes the resulting output
  4436.   to CleanExample.p.
  4437.  
  4438.   Warning Beware of command formats such as
  4439.  
  4440.   Entab Foo > Foo
  4441.  
  4442.   Limitations Entab does not take into account embedded formatting
  4443.   characters other than tab characters. Thus backspace characters may
  4444.   cause incorrect results.
  4445.  
  4446.   The maximum width for an input line is 255 characters.
  4447.  
  4448.  
  4449.                              See also 
  4450.  
  4451.   Format command.
  4452.  
  4453. æKY Equal
  4454. æC                Equal -- compare files and directories
  4455.  
  4456. Equal [-d | -r] [-i] [-p] [-q] name… target  > differences ≥ progress
  4457.    -d                      # compare data forks only
  4458.    -r                      # compare resource forks only
  4459.    -i                      # ignore files in target not in directory name
  4460.    -p                      # write progress information to diagnostics
  4461.    -q                      # quiet - don't write output, just set {Status}
  4462.  
  4463. Status codes returned:
  4464.   0    Identical files.
  4465.   1    Syntax error.
  4466.   2    Inaccessible or missing parameter.
  4467.   3    Files not equal.
  4468.  
  4469.                            Description
  4470.  
  4471.   Compares name to targetName. By default, Equal makes no comment if
  4472.   files are the same; if they differ, it announces the byte at which
  4473.   the difference occurred. When comparing directories, the default
  4474.   condition is to report all differences, including files not found—the
  4475.   -i option ignores files in targetName that are not present in name.
  4476.  
  4477.   If targetName is a file, every name must also be a file. The specified
  4478.   files are compared with targetName.
  4479.  
  4480.   If targetName is a directory and name is a file, Equal checks in
  4481.   targetName for the file name and compares the two files. That is,
  4482.   the command
  4483.  
  4484.   Equal File1 Dir1
  4485.  
  4486.   compares File1 with :Dir1:File1.
  4487.  
  4488.   If more than one name is specified, Equal compares each name with
  4489.   the corresponding file or directory in targetName. All subdirectories
  4490.   are also compared. For example,
  4491.  
  4492.   Equal File1 Dir1 Dir2
  4493.  
  4494.   If targetName is a directory, name is a directory, and only one name
  4495.   is specified, the Equal command directly compares the two directories.
  4496.   That is, the command
  4497.  
  4498.   Equal Dir1 Dir2
  4499.  
  4500.   compares Dir1 (and all subdirectories) with Dir2.
  4501.  
  4502.  
  4503.                              Examples
  4504.  
  4505.   Equal File1 File1Backup
  4506.  
  4507.   Reports if the files are different and at what point they differ,
  4508.   in a message
  4509.  
  4510.   such as
  4511.  
  4512.   File1 File1Backup differ in data fork, at byte 5
  4513.  
  4514.   Equal -i HD:Dir1 Disk1:Dir1
  4515.  
  4516.   Compares all files and directories in HD:Dir1 with files and directories
  4517.   with the same names found in Disk1:Dir1, and reports any differences.
  4518.   This command does not report files in Disk1:Dir1 that aren’t found
  4519.   in HD:Dir1.
  4520.  
  4521.   Equal -i -d Backup: HD:Source
  4522.  
  4523.   Compares the data forks of all files on the volume Backup: with all
  4524.   those of the same name in the directory HD:Source.
  4525.  
  4526.   Equal -p Old:≈.c HD:Source
  4527.  
  4528.   Compares all files on Old: ending in ".c" with their counterparts
  4529.   in HD:Source. Prints progress information as the comparison proceeds.
  4530.  
  4531.  
  4532.                              See also 
  4533.  
  4534.   Compare command.
  4535.  
  4536. æKY Erase
  4537. æC                     Erase -- initialize volumes
  4538.  
  4539. Erase [-y] [-s] volume…
  4540.  -y                      # yes - erase the disk (avoids dialog)
  4541.  -s                      # single-sided - 400K (default 800K)
  4542.  
  4543. Status codes returned:
  4544.   0    Successful initialization.
  4545.   1    Syntax error.
  4546.   2    No such volume, or boot volume.
  4547.   3    Errors during the initialization procedure.
  4548.  
  4549.                            Description
  4550.  
  4551.   Initializes the specified volumes— the previous contents are destroyed.
  4552.   A volume name must end with a colon ( : ). If volume is a number
  4553.   without a colon, it’s interpreted as a disk drive number.
  4554.  
  4555.   A dialog box requests confirmation before proceeding with the command,
  4556.   unless the -y option is specified. The -y option can be used in scripts
  4557.   to avoid this interaction.
  4558.  
  4559.  
  4560.                              Examples
  4561.  
  4562.   Erase Reports:
  4563.  
  4564.   Initializes the volume entitled Reports.
  4565.  
  4566.   Erase 1
  4567.  
  4568.   Initializes the volume in drive 1 (the internal drive). The disk
  4569.   will be formatted as a 400K disk if drive 1 is a 400K drive, or as
  4570.   an 800K disk if drive 1 is an 800K drive.
  4571.  
  4572. æKY Evaluate
  4573. æC                  Evaluate -- evaluate an expression
  4574.  
  4575. Evaluate [-h | -o | -b] [word…]  > value
  4576. Evaluate Name [binary operator]= expression
  4577.   -h                      # display result in hexadecimal (leading 0x)
  4578.   -o                      # display result in octal (leading 0)
  4579.   -b                      # display result in binary (leading 0b)
  4580.  
  4581. Status codes returned:
  4582.   0    Valid expression.
  4583.   1    Invalid expression.
  4584.  
  4585.                            Description
  4586.  
  4587.   The list of words is taken as an expression. After evaluation, the
  4588.   result is written to standard output. Missing or null parameters
  4589.   are taken as zero. You should quote string operands that contain
  4590.   blanks or any of the characters listed in the table that follows.
  4591.  
  4592.   The operators and precedence are mostly those of the C language;
  4593.   descriptions follow.
  4594.  
  4595.   The second form of the Evaluate command evaluates the list of words
  4596.   and assigns the result to the variable name. The result of the expression
  4597.   is not written to standard output in this case. C style operations
  4598.   of the form "+=", "-=", and so on, are supported. If name is undefined
  4599.   at the time of execution, it is interpreted as zero.
  4600.  
  4601.   Different radices can be used in the input expression, and the result
  4602.   can be output in a different radix by using the -h, -o, or -b option.
  4603.   The default radix is decimal.
  4604.  
  4605.   Expressions: An expression can include any of the following operators.
  4606.   (In some cases, two or three different symbols can be used for the
  4607.   same operation.) The operators are listed in order of precedence;
  4608.   within each group, operators have the same precedence.
  4609.  
  4610.   Operator           Operation
  4611.  
  4612.   1. (expr)          Parentheses are used to group expressions
  4613.  
  4614.   2.  -              Unary negation
  4615.  
  4616.       ~              Bitwise negation
  4617.  
  4618.       !              NOT ¬ Logical NOT
  4619.  
  4620.   3.  *              Multiplication
  4621.  
  4622.       ÷              DIV Division
  4623.  
  4624.      %               MOD Modulus division
  4625.  
  4626.   4. +               Addition
  4627.  
  4628.      -               Subtraction
  4629.  
  4630.   5. <<              Shift left
  4631.  
  4632.      >>              Shift right
  4633.  
  4634.   6. <               Less than
  4635.  
  4636.      <= ≤            Less than or equal to
  4637.  
  4638.      >               Greater than
  4639.  
  4640.      >= ≥            Greater than or equal to
  4641.  
  4642.   7. ==              Equal
  4643.  
  4644.      != <> ≠         Not equal
  4645.  
  4646.      =~              Equal—regular expression
  4647.  
  4648.      !~              Not equal—regular expression
  4649.  
  4650.   8. &               Bitwise AND
  4651.  
  4652.   9. ^               Bitwise XOR
  4653.  
  4654.   10. |              Bitwise OR
  4655.  
  4656.   11. && AND         Logical AND
  4657.  
  4658.   12. || OR          Logical OR
  4659.  
  4660.   All operators group from left to right. Parentheses can be used to
  4661.   override the operator precedence. Null or missing operands are interpreted
  4662.   as zero. The result of an expression is always a string representing
  4663.   a number in the specified radix (the default is decimal).
  4664.  
  4665.   The logical operators !, NOT, ¬, &&, AND, | |, and OR interpret null
  4666.   and zero operands as false, and nonzero operands as true. Relational
  4667.   operators return the value 1 when the relation is true, and the value
  4668.   0 when the relation is false.
  4669.  
  4670.   The string operators ==, !=, =~, and !~ compare their operands as
  4671.   strings. All others operate on numbers. Numbers may be decimal, hexadecimal,
  4672.   octal, or binary integers representable by a 32-bit signed value.
  4673.   Hexadecimal numbers begin with either $ or 0x. Octal numbers begin
  4674.   with a 0 (zero). Binary numbers begin with 0b. Every expression is
  4675.   computed as a 32-bit signed value. Overflows are ignored.
  4676.  
  4677.   Input Radices
  4678.  
  4679.   Decimal number [0–9]
  4680.  
  4681.   Hexadecimal number 0x[0–9A–F]
  4682.  
  4683.   Octal number 0[0–7]
  4684.  
  4685.   Binary number 0b[01]
  4686.  
  4687.   The pattern-matching operators =~ and !~ are like == and != except
  4688.   that the right side is a regular expression that is matched against
  4689.   the left operand. Regular expressions must be enclosed within the
  4690.   regular expression delimiters /…/. Regular expressions are summarized
  4691.   in Appendix B.
  4692.  
  4693.     • Note: There is one difference between using regular expressions
  4694.     after =~ and !~ and using them in editing commands. When evaluating
  4695.     an expression that contains the tagging operator, ®, the Shell
  4696.     creates variables of the form {®n}, containing the matched substrings
  4697.     for each ® operator. (See the examples that follow.)
  4698.  
  4699.   Filename generation, conditional execution, pipe specifications,
  4700.   and input/output specifications are disabled within expressions,
  4701.   to allow the use of many special characters that would otherwise
  4702.   have to be quoted.
  4703.  
  4704.   Expressions are also used in the If, Else, Break, Continue, and Exit
  4705.   commands.
  4706.  
  4707.  
  4708.                              Examples
  4709.  
  4710.   Evaluate (1+2) * (3+4)
  4711.  
  4712.   Does the computation and writes the result to standard output.
  4713.  
  4714.   Evaluate -h 8 + 8
  4715.  
  4716.   Does the computation and writes the result to standard output in
  4717.   hexadecimal (0x10).
  4718.  
  4719.   Evaluate 0xA + 6
  4720.  
  4721.   Writes the result 16 to standard output. (The default output radix
  4722.   is decimal. Use -h for hexadecimal.)
  4723.  
  4724.   Evaluate lines += 1
  4725.  
  4726.   The Evaluate command increments the value of the Shell variable {lines}
  4727.   by 1. If {lines} was undefined before executing the command, {lines}
  4728.   would be 1 after execution.
  4729.  
  4730.   ( Evaluate "{aPathname}" =~ /(([¬:]+:)*)®1≈/ ) > Dev:Null
  4731.  
  4732.   Echo {®1}
  4733.  
  4734.   These commands examine a pathname contained in the variable {aPathname}
  4735.   and return the directory prefix portion of the name. In this case,
  4736.   Evaluate is used for its side effect of enabling regular expression
  4737.   processing of a filename pattern. The right side of the expression
  4738.   ( /(([¬:]+:)*)®1≈/ ) is a regular expression that matches everything
  4739.   in a pathname up to the last colon and remembers it as the Shell
  4740.   variable {®1}. Evaluate’s actual output is not of interest, so it’s
  4741.   redirected to the bit bucket, Dev:Null. (See "Pseudo-Filenames" in
  4742.   Chapter 5.) Note that the use of I/O redirection means that the Evaluate
  4743.   command must be enclosed in parentheses so that the output redirection
  4744.   symbol, >, is not taken as an expression operator.
  4745.  
  4746.   This is a complex but useful example of implementing a "substring"
  4747.   function. For a similar example, see the Rename command.
  4748.  
  4749.  
  4750.                              See also 
  4751.  
  4752.   "Structured Commands" in Chapter 5.
  4753.  
  4754.   "Pattern Matching (Using Regular Expressions)" in Chapter 6, and
  4755.   Appendix B.
  4756.  
  4757. æKY Execute
  4758. æC         Execute -- execute command file in the current scope
  4759.  
  4760. Execute commandFile
  4761.  
  4762. Execute returns the status returned by script.
  4763.  
  4764.                            Description
  4765.  
  4766.   Executes the script as if its contents appeared in place of the Execute
  4767.   command. This means that variable definitions, exports, and aliases
  4768.   in the script will continue to exist after it has finished executing.
  4769.   (Normally these definitions, exports, and aliases would be local
  4770.   to the script.) Any parameters following script are ignored. Any
  4771.   parameters to the enclosing script are available within script.
  4772.  
  4773.     • Note: If script is not a command file (that is, if it’s a built-in
  4774.     command, tool, or application), the command is run as if the
  4775.     word Execute did not appear. Parameters are passed to the command
  4776.     as usual.
  4777.  
  4778.  
  4779.                              Examples
  4780.  
  4781.   Execute {ShellDirectory}Startup
  4782.  
  4783.   Executes the Startup (and UserStartup) scripts. This command is useful
  4784.   for testing any changes you’ve made to the Startup-UserStartup script.
  4785.   Variable definitions, exports, and aliases set in Startup and UserStartup
  4786.   will be available after Startup is done executing.
  4787.  
  4788.  
  4789.                              See also 
  4790.  
  4791.   "Defining and Redefining Variables" in Chapter 5.
  4792.  
  4793.   "The Startup and UserStartup Files" in Chapter 5.
  4794.  
  4795. æKY Exists
  4796. æC        Exists -- confirm the existence of a file or directory
  4797.  
  4798. Exists [-d | -f | -w] [-q] name…  > file
  4799.   -d                      # check if name is a directory
  4800.   -f                      # check if name is a file
  4801.   -w                      # check if name is a file and writeable
  4802.   -q                      # don't quote file names with special characters
  4803.  
  4804. Status codes returned:
  4805.   0    No error.
  4806.   1    Syntax error.
  4807.   2    Other error.
  4808.  
  4809.                            Description
  4810.  
  4811.   Determines the existence of the file or directory name. The options
  4812.   help you to distinguish between directories and files and different
  4813.   access permissions. The nonexistence of name is not considered an
  4814.   error (status remains zero).
  4815.  
  4816.  
  4817.                              Examples
  4818.  
  4819.   If Not "`Exists -d HD:dir`"
  4820.     NewFolder HD:dir
  4821.   End
  4822.   Duplicate ≈.c HD:dir
  4823.  
  4824.   This example creates a new directory and copies all files ending
  4825.   with ".c" in the current directory to this new directory.
  4826.  
  4827.  
  4828.                              See also 
  4829.  
  4830.   Newer command.
  4831.  
  4832. æKY Exit
  4833. æC                   Exit -- exit from a command file
  4834.  
  4835. Exit [status] [If expression]
  4836.  
  4837. If status is present, it is returned as the status value of the 
  4838. script. If the expression is invalid, –5 is returned. Otherwise, the status 
  4839. of the last command executed is returned. 
  4840.  
  4841.                            Description
  4842.  
  4843.   If the expression is nonzero (that is, true), Exit terminates execution
  4844.   of the script in which it appears. When used interactively, Exit
  4845.   terminates execution of previously entered commands. Status is a
  4846.   number; if present, it is returned as the status value of the script.
  4847.   Otherwise, the status of the previous command is returned. If the
  4848.   "If expression" is omitted, the Exit is unconditional. (For a definition
  4849.   of expression, refer to the description of the Evaluate command.)
  4850.  
  4851.  
  4852.                              Examples
  4853.  
  4854.   Exit {ExitStatus}
  4855.  
  4856.   As the last line of a script, this Exit command would return as a
  4857.   status value whatever value had previously been assigned to {ExitStatus}.
  4858.  
  4859.  
  4860.                              See also 
  4861.  
  4862.   Evaluate command (for information on expressions).
  4863.  
  4864.   "Structured Commands" in Chapter 5.
  4865.  
  4866.   {Exit} and {Status} variables, in "Variables," Chapter 5.
  4867.  
  4868. æKY Export
  4869. æC            Export -- make variables available to commands
  4870.  
  4871. Export [-r | -s | name…]  > exports
  4872.  -r                      # generate Unexport commands for all exported variables
  4873.  -s                      # print the names only
  4874.  
  4875. Status codes returned:
  4876.   0    No errors.
  4877.   1    Syntax error.
  4878.  
  4879.                            Description
  4880.  
  4881.   Make the specified variables available to scripts and tools. The
  4882.   list of variables exported within a script is local to that script.
  4883.   An enclosed script or tool inherits a list of exported variables
  4884.   from the enclosing script . (See Figure 5-1 in Chapter 5 of the MPW manual
  4885.   for clarification.)
  4886.  
  4887.     • Note: You can make a variable available to all scripts and
  4888.     tools by setting and exporting it in the Startup or UserStartup
  4889.     files. (Startup acts as the enclosing script for all Shell operations.)
  4890.  
  4891.   If no names are specified, a list of exported variables is written
  4892.   to standard output. (Note that the default output of Export is in
  4893.   the form of Export commands.)
  4894.  
  4895.  
  4896.                              Examples
  4897.  
  4898.   Set AIncludes {MPW}Interfaces:AIncludes:
  4899.  
  4900.   Export AIncludes
  4901.  
  4902.   Defines the variable {AIncludes} as the pathname {MPW}Interfaces:AIncludes:
  4903.   and makes it available to scripts and programs.
  4904.  
  4905.  
  4906.                              See also 
  4907.  
  4908.   Unexport, Set, and Execute commands.
  4909.  
  4910.   "The Startup and UserStartup Files" in Chapter 5.
  4911.  
  4912.   "Exporting Variables" in Chapter 5.
  4913.  
  4914. æKY FileDiv
  4915. æC          FileDiv -- divide a file into several smaller files
  4916.  
  4917. FileDiv [option…] file [prefix]  ≥ progress
  4918.  -b              # input is a byte stream instead of lines
  4919.  -f              # split file at formfeed character
  4920.  -n splitPoint   # split file after splitPoint lines or bytes (-b)
  4921.  -p              # write progress information to diagnostics
  4922.  -s n            # set -b input buffer to n * 512 bytes
  4923.  
  4924. Status codes returned:
  4925.   0    Normal termination.
  4926.   1    Parameter or option error.
  4927.  
  4928.                            Description
  4929.  
  4930.   FileDiv is the inverse of the Catenate command. It is used to break
  4931.   a large file into several smaller pieces. The input file is divided
  4932.   into smaller files, each containing an equal number of lines determined
  4933.   by the splitpoint (default=2000). The last file contains whatever
  4934.   is left over.
  4935.  
  4936.   There is also an option (-f) for splitting a file only when a form
  4937.   feed character
  4938.  
  4939.   (ASCII $0C) occurs as the first character of a line that is beyond
  4940.   the splitpoint. This option lets you split a file at points that
  4941.   are known to be the tops of pages.
  4942.  
  4943.   Each group of splitpoint lines is written to a file with the name
  4944.   prefixNN, where NN is a number starting at 01. If the prefix is omitted,
  4945.   the input file name is used as the prefix.
  4946.  
  4947.  
  4948.                              Examples
  4949.  
  4950.   FileDiv -f -n 2500 Bigfile
  4951.  
  4952.   Splits Bigfile into files of at least 2500 lines; splits the file
  4953.   at points where there are form feed characters. The output files
  4954.   have the names BigfileNN, where NN is 01, 02, and so on.
  4955.  
  4956.   Limitation The maximum length of an input line is 255 characters.
  4957.  
  4958. æKY Files
  4959. æC                  Files -- list files and directories
  4960.  
  4961. Files [option…] [name…]  > fileList
  4962.  -c creator              # list only files with this creator
  4963.  -d                      # list only directories
  4964.  -f                      # list full pathnames
  4965.  -i                      # treat all arguments as files
  4966.  -l                      # long format (type, creator, size, dates, etc.)
  4967.  -m columns              # n column format, where n = columns
  4968.  -n                      # don't print header in long or extended format
  4969.  -o                      # omit directory headers
  4970.  -q                      # don't quote filenames with special characters
  4971.  -r                      # recursively list subdirectories
  4972.  -s                      # suppress the listing of directories
  4973.  -t type                 # list only files of this type
  4974.  -x format               # extended format with the fields specified by format
  4975.  
  4976.  Note: The following characters can specify the format
  4977.      a   Flag attributes
  4978.      b   Logical size, in bytes, of the data fork
  4979.      r   Logical size, in bytes, of the resource fork
  4980.      c   Creator of File ("Fldr" for folders)
  4981.      d   Creation date
  4982.      k   Physical size in kilobytes of both forks
  4983.      m   Modification date
  4984.      t   Type
  4985.      o   Owner (only for folders on a file server)
  4986.      g   Group (only for folders on a file server)
  4987.      p   Privileges (only for folders on a file server)
  4988.  
  4989. Status codes returned:
  4990.   0    All names were processed successfully.
  4991.   1    Syntax error.
  4992.   2    An error occurred.
  4993.  
  4994.                            Description
  4995.  
  4996.   For each disk or directory named, Files lists its contents; for each
  4997.   file named, Files writes its name and any other information requested.
  4998.   Information is written to standard output. When a directory is listed,
  4999.   all subdirectories are listed first in alphabetical order, followed
  5000.   by all files in alphabetical order. If no name is given, the current
  5001.   directory is listed.
  5002.  
  5003.  
  5004.                              Examples
  5005.  
  5006.   files -r -s -f
  5007.  
  5008.   HD:source:defs.h
  5009.   HD:source:main.c
  5010.   HD:source:backup:main.c
  5011.   HD:source:backup:defs.h
  5012.   HD:source:junk:tmpfile
  5013.  
  5014.   Recursively lists the contents of the current directory, giving full
  5015.   pathnames and suppressing the printing of directory names.
  5016.  
  5017.   files -d
  5018.  
  5019.   :backup:
  5020.   :junk:
  5021.  
  5022.   Lists only the directories in the current directory.
  5023.  
  5024.   Files -i -x kd {AIncludes}
  5025.  
  5026.   Name                         Size    Creation-Date
  5027.   --------------------------- ------ ----------------
  5028.   HD:MPW:Interfaces:AIncludes: 365K   8/25/87 5:32 AM
  5029.  
  5030.   Lists the size and creation date of the {AIncludes} directory. Notice
  5031.   how the -i option is used to avoid printing the contents of the directory.
  5032.  
  5033.   files -m 2
  5034.  
  5035.   :backup: deFs.h
  5036.   :junk: main.c
  5037.  
  5038.   This is the two-column format. Notice the order of the files.
  5039.  
  5040. æKY Find
  5041. æC                Find -- find and select a text pattern
  5042.  
  5043. Find [-c count] selection [window]
  5044.  -c count                # find the nth selection, where n = count
  5045.  
  5046. Status codes returned:
  5047.   0    At least one instance of the selection was found.
  5048.   1    Syntax error.
  5049.   2    Any other error.
  5050.  
  5051.                            Description
  5052.  
  5053.   Creates a selection in window. If no window is specified, the target
  5054.   window (the second window from the front) is assumed. It’s an error
  5055.   to specify a window that doesn’t exist.
  5056.  
  5057.   Selection is a selection as defined in Chapter 6 and in Appendix B of the
  5058.   MPW manual.
  5059.  
  5060.     • Note: Searches do not necessarily start at the beginning of
  5061.     a window. A forward search begins at the end of the current selection
  5062.     and continues to the end of the document. A backward search begins
  5063.     at the start of the current selection and continues to the beginning
  5064.     of the document.
  5065.  
  5066.   All searches are not case sensitive by default. You can specify case-sensitive
  5067.   searches by first setting the Shell variable {CaseSensitive} to a
  5068.   nonzero value. (Or, you can automatically set {CaseSensitive} by
  5069.   checking Case Sensitive in the dialog boxes displayed by the Find
  5070.   and Replace menu items.)
  5071.  
  5072.  
  5073.                              Examples
  5074.  
  5075.   Find •
  5076.  
  5077.   Positions the insertion point at the beginning of the target window.
  5078.  
  5079.   Find -c 5 /procedure/ Sample.p
  5080.  
  5081.   Selects the fifth occurrence of "procedure" in the window Sample.p.
  5082.  
  5083.   Find 332
  5084.  
  5085.   Selects line 332 in the target window.
  5086.  
  5087.  
  5088.                              See also 
  5089.  
  5090.   "Selections" and "Pattern Matching" in Chapter 6, and Appendix B.
  5091.  
  5092.   "Find Menu" in Chapter 3.
  5093.  
  5094. æKY Flush
  5095. æC          Flush -- flush the tools that the Shell has cached
  5096.  
  5097. Flush
  5098. \.
  5099. Status codes returned:
  5100.   0    No errors always returned.
  5101.  
  5102.                            Description
  5103.  
  5104.   Flush clears the MPW Shell's tool cache.
  5105.  
  5106.   The MPW Shell keeps the most recently used tools in memory so that
  5107.   execution can be faster. However, there are times when you don’t
  5108.   want the tools to be in the cache. For example, you cannot run a
  5109.   tool, and then switch to the Finder and delete the file. The Finder
  5110.   will report that the tool is busy. You might also want to flush the
  5111.   cache is when you are running benchmarks or timing tool performance.
  5112.  
  5113.  
  5114.                              Examples
  5115.  
  5116.   Flush
  5117.  
  5118.   Flush the current cache. This will free all tools in the cache.
  5119.  
  5120. æKY For
  5121. æC                  For -- repeat commands once per parameter
  5122.  
  5123. For name In word…
  5124.  command…
  5125. End
  5126.  
  5127. Status codes returned:
  5128.   0    The list of words or list of commands was empty.
  5129.   –3   There was an error in the parameters to For.
  5130.  
  5131.                            Description
  5132.  
  5133.   Executes the list of commands once for each word from the "In word…"
  5134.   list. The current word is assigned to variable name, and you can
  5135.   therefore reference it in the list of commands by using the notation
  5136.   {name}. You must end each line with either a return character (as
  5137.   shown above) or with a semicolon (;).
  5138.  
  5139.   The Break command can be used to terminate the loop. The Continue
  5140.   command can be used to terminate the current iteration of the loop.
  5141.  
  5142.   The pipe specification (|), conditional command terminators (&& and
  5143.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, and ∑∑)
  5144.   may appear following the End; they apply to all of the commands in
  5145.   the list.
  5146.  
  5147.  
  5148.                              Examples
  5149.  
  5150.   For i In 1 2 3
  5151.     Echo i = {i}
  5152.   End
  5153.  
  5154.   Returns the following:
  5155.  
  5156.   i = 1
  5157.   i = 2
  5158.   i = 3
  5159.  
  5160.   For File In ≈.c
  5161.     C {File} ; Echo {File} compiled.
  5162.   End
  5163.  
  5164.   This example compiles every file in the current directory whose name
  5165.   ends with the suffix ".c". The Shell first expands the filename pattern
  5166.   ≈.c, creating a list of the filenames after the "In" word. The enclosed
  5167.   commands are then executed once for each name in the list. Each time
  5168.   the loop is executed, the variable {File} represents the current
  5169.   word in the list. {File} is quoted because a filename could contain
  5170.   spaces or other special characters.
  5171.  
  5172.   For file in Startup UserStartup Suspend Resume Quit
  5173.     Entab {file} > temp
  5174.     Rename -y temp {file}
  5175.     Print -h {file}
  5176.     Echo {file}
  5177.   End
  5178.  
  5179.   This example entabs (replaces multiple spaces with tabs) the five
  5180.   files listed, prints them with headings, and echoes the name of each
  5181.   file after printing is complete. You might want to use this set of
  5182.   commands before making copies of the files to give to a friend. Entabbing
  5183.   the files saves considerable disk space, and printing them gives
  5184.   you some quick documentation to go with the files.
  5185.  
  5186.  
  5187.                              See also 
  5188.  
  5189.   Loop, Break, and Continue commands.
  5190.  
  5191.   "Structured Commands" in Chapter 5.
  5192.  
  5193. æKY Format
  5194. æC        Format -- set or display formatting options for a window
  5195.  
  5196. Format [[-f font] [-s fontsize] [-t tabsize] [-a attr]] | [-x fmt] [window…]
  5197.  -f fontName             # set font to fontName
  5198.  -s fontSize             # set the font size to fontSize
  5199.  -t tabSize              # set the tab size to tabSize
  5200.  -a attr                 # set the auto indent and show invisibles flags
  5201.  -x fmt                  # output the current format in the specified format
  5202.  
  5203.  Note: The following attributes may be used with the -a option:
  5204.      A   auto indentation on
  5205.      a   auto indentation off
  5206.      I   show invisibles on
  5207.      i   show invisibles off
  5208.      L   lock auto scrolling
  5209.      l   unlock auto scrolling
  5210.  
  5211.  Note: The following characters may be used with the -x option:
  5212.      f   font name
  5213.      s   font size
  5214.      t   tab size
  5215.      a   attributes
  5216.  
  5217. Status codes returned:
  5218.   0    No errors.
  5219.   1    Syntax error (error in parameters).
  5220.   2    All other errors.
  5221.  
  5222.                            Description
  5223.  
  5224.   This is a scriptable form of the Format menu command in the Edit
  5225.   menu. Use it to set the format of a specified list of windows. If
  5226.   no window is specified, the command operates on the target window.
  5227.   If no options are specified (other than -x), the current format settings
  5228.   are written to standard output.
  5229.  
  5230.     • Note: The Format command (and the Format menu command) modify
  5231.     the format of an existing window. The format related variables
  5232.     such as {Tab} and {Font} are used to initialize the format of
  5233.     a new window.
  5234.  
  5235.  
  5236.                              Examples
  5237.  
  5238.   Format -f Monaco -t 8 -a A {target}
  5239.  
  5240.   Sets the font, tab size, and auto-indent in the target window. The
  5241.   font size and invisible settings are not changed.
  5242.  
  5243.   Format -s 12 MyWindow
  5244.  
  5245.   Changes the font size in MyWindow to 12 point.
  5246.  
  5247.   Format {Target}
  5248.  
  5249.   A format statement with no options displays the current format of
  5250.   the window, such as the following:
  5251.  
  5252.   Format -f Monaco -s 9 -t 8 -a Ai
  5253.  
  5254.   You can then select and execute this output format.
  5255.  
  5256.   Format -x tsf
  5257.  
  5258.   4 9 Monaco
  5259.  
  5260.   Displays only the values of the specified options. Use this option
  5261.   for easily retrieving one or two values and assigning them to Shell
  5262.   variables for later use.
  5263.  
  5264.  
  5265.                              See also 
  5266.  
  5267.   The "Edit Menu," in Chapter 3.
  5268.  
  5269.   "Variables" in Chapter 5.
  5270.  
  5271. æKY Get
  5272. æC             Get -- get a record from an indexed file
  5273.  
  5274. Get (dataFile… | -dfl listfFle) [-k key] [-width w] [-d default key] [-h | -h2] 
  5275.     [-l] [-m] [-nf] [-q] [-s]  [-x] [-search] [-t] [-sfl] [-y] [-field field list] 
  5276.     [-format format string] ] [-lessFields field list]
  5277.  
  5278.  
  5279.     dataFile                # A specially formatted help file which must be 
  5280.                             # accompanied by an index file whose name is of 
  5281.                             # the form: dataFile.index, and and whose type is 'btre'
  5282.     -dfl listFile           # listFile contains a list of datafiles
  5283.     -k keyword              # keyword in the datafile's index file
  5284.     -width w                # column format for key lists, w = 1..200 is the 
  5285.                             # window width in characters
  5286.     -d default              # use default keyword if no keyword is specified
  5287.     -h                      # write full header
  5288.     -h2                     # write short header (only the used datafile)
  5289.     -l                      # list all keys in the first data file that begin
  5290.                             # with nnn, where nnn is the keyword following -k
  5291.     -lessFields tag [,tag]… # remove the named items from the existing field list 
  5292.                             # (default list or as specified by -field)
  5293.     -m                      # Select the keyword that was found and assign a marker to the selection
  5294.     -nf                     # no filtering; include field tags
  5295.     -q                      # quiet output when keyword not found
  5296.     -s                      # use the selection in the active window as keyword
  5297.     -x                      # create or update the cross reference index file
  5298.     -search                 # text search datafile for occurrences of keyword
  5299.     -t                      # write out template of the requested function/procedure
  5300.     -field tag[,tag]…       # specify the data field(s) to display
  5301.     -format format_string   # specify string(s) to be output in front of data
  5302.                             # specified in -field option.  '%s' flags in string 
  5303.                             # correspond ordinally to tags in -field option
  5304.     -sfl                    # produce ordered list of data files 
  5305.                             # (requires -dfl listFile)
  5306.     -y                      # do not present dialog before (re)building index file
  5307.  
  5308. Status codes returned:  
  5309.   0    The search was successful
  5310.   1    There was a syntax error
  5311.   2    There was an error in processing
  5312.   3    There was a system or out of memory error
  5313.   4    The key was not found.
  5314.  -9    The user aborted the program
  5315.    
  5316.                            Description
  5317.  
  5318.   Get searches the btree file dataFile.index looking for the key word
  5319.   key. If found, Get will return data associated with the key word from 
  5320.   the file dataFile.  The data may be formatted by columns.
  5321.  
  5322. æKY GetErrorText
  5323. æC     GetErrorText -- display error messages based on message number
  5324.  
  5325. GetErrorText [-f filename] [-s filename] [-n] [-p] errnbr[,insert,…] …
  5326. GetErrorText -i idnbr,…
  5327.  # display error messages based on message number
  5328.  
  5329.  -f filename             # explicit error msg file
  5330.  -i idnbr                # report meaning of System Error Handler ID number
  5331.  -n                      # suppress error numbers in displayed messages
  5332.  -p                      # write SysErrs's version info to diagnostics
  5333.  -s filename             # explicit system error msg file (default SysErrs.Err)
  5334.  
  5335. Status codes returned:
  5336.   0    Normal termination.
  5337.   1    Parameter or option error.
  5338.  
  5339.                            Description
  5340.  
  5341.   Displays the error messages corresponding to a set of specified error
  5342.   numbers or ID numbers. By default, GetErrorText assumes that the
  5343.   error numbers correspond to Macintosh Operating System error numbers.
  5344.   The file SysErrs.Err is a special file used by MPW tools to determine
  5345.   the error messages corresponding to system error numbers. Other system
  5346.   error message files may be specified by using the -s option.
  5347.  
  5348.   In addition to system errors, some tools have their own error message
  5349.   files. For example, the assembler's error message file is in the
  5350.   data resource fork of Asm itself. For such tools, you can display
  5351.   the error messages corresponding to tool error numbers by specifying
  5352.   the -f option. In this case, you can specify sample inserts, along
  5353.   with the error numbers, for error messages that take inserts, as
  5354.   shown above.
  5355.  
  5356.   GetErrorText can also display the meanings of the ID numbers reported
  5357.   by the System Error Handler in alert dialog boxes. The -i option
  5358.   is used for this purpose.
  5359.  
  5360.  
  5361.                              Examples
  5362.  
  5363.   GetErrorText -43 -44 -45
  5364.  
  5365.   Displays the error messages corresponding to system errors -43, -44,
  5366.   and -45.
  5367.  
  5368.   GetErrorText -i 28 2
  5369.  
  5370.   Displays the error messages corresponding to system ID numbers 28
  5371.   and 2.
  5372.  
  5373. æKY GetFileName
  5374. æC          GetFileName -- display a Standard File dialog box
  5375.  
  5376. GetFileName [-q] [-s] 
  5377.             [-c | [[-t TYPE]… | -p | -d | -wd] [-m message] [-b buttontitle] [pathname]]
  5378.     -b buttontitle          # specify the default button's title
  5379.     -c                      # write current standard file path to standard output
  5380.     -d                      # select a directory
  5381.     -wd                     # select a directory on a non-locked volume
  5382.     -m message              # specify a prompt
  5383.     -p                      # select a new filename (SFPutFile) 
  5384.     -q                      # suppress quoting of filenames
  5385.     -s                      # return 0 status even if cancel is clicked
  5386.     -t type                 # specify file type for SFGetFile dialog
  5387.  
  5388. Status codes returned:
  5389.   0    User specified a file and no errors occurred.
  5390.   1    Parameter or option error.
  5391.   2    System error.
  5392.   4    User canceled the standard file dialog box.
  5393.  
  5394.                            Description
  5395.  
  5396.   GetFileName displays a standard file dialog box. Either SFPutFile
  5397.   or SFGetFile is called, and the returned filename or pathname is
  5398.   written to standard output. The standard file starting directory
  5399.   is set to pathname if specified. If pathname includes a local filename
  5400.   and if SFPutFile is called, the local filename is used as the default
  5401.   filename. See the examples.
  5402.  
  5403.  
  5404.                              Examples
  5405.  
  5406.   Open `GetFileName -t TEXT {pinterfaces}`
  5407.  
  5408.   Opens the text file in directory {pinterfaces} chosen in SFGetFile
  5409.   by the user.
  5410.  
  5411.   GetFileName -p HD:MPW:StartUp
  5412.  
  5413.   An SFPutFile dialog box is displayed with the directory set to HD:MPW:
  5414.   and StartUp is displayed in the textedit field of the dialog box.
  5415.  
  5416.   Limitation The resulting filename cannot be longer than 255 characters.
  5417.  
  5418.  
  5419.                              See also 
  5420.  
  5421.   "The Standard File Package," Inside Macintosh, Volume I.
  5422.  
  5423. æKY GetListItem
  5424. æC      GetListItem -- display items for selection in a dialog box
  5425.  
  5426. GetListItem [option…] [[item…] | < file]
  5427.     -c[ancel]               # return a status of 0 even when cancel is clicked
  5428.     -d[efault] item         # item is entered in list and comes up selected
  5429.     -m[essage] message      # display message in dialog above the list
  5430.     -q[uote]                # don't quote items in the output
  5431.     -r[ows] rows            # make the list with this many rows
  5432.     -s[ingle]               # only allow a single selection
  5433.     -w[idth] width          # make the list this many pixels wide
  5434.  
  5435. Status codes returned:
  5436.   0    No errors (or Cancel button was clicked if  -c option is used).
  5437.   1    Syntax error (bad option).
  5438.   2    Cancel button was clicked.
  5439.  
  5440.                            Description
  5441.  
  5442.   Takes the items on the command line (or, if no items are present
  5443.   on the command line, items from standard input) and lists them in
  5444.   a dialog box. Items in the list can be selected with the mouse and
  5445.   modifier keys. Selected items are written to standard output when
  5446.   the OK button is clicked.
  5447.  
  5448.  
  5449.                              Examples
  5450.  
  5451.   Print `files -t TEXT | GetListItem -m "Select files to print:"`
  5452.  
  5453.   Lists all text files in the current directory and prints those selected
  5454.   by the user, as shown below.
  5455.  
  5456. æKY Help.MPW
  5457. æC                  Help -- write summary information
  5458.  
  5459. Help [-f helpfile] [command…]  > helpInformation
  5460.  -f helpfile             # alternate helpfile (default MPW.Help)
  5461.  
  5462. Status codes returned:
  5463.   0    Information was found for the given command.
  5464.   1    Syntax error.
  5465.   2    A command could not be found.
  5466.   3    The help file could not be opened.
  5467.  
  5468. æKY If
  5469. æC                 If -- conditional command execution
  5470.  
  5471. If expression
  5472.  command…
  5473. [Else If expression
  5474.  command… ] …
  5475. [Else
  5476.  command… ]
  5477. End
  5478.  
  5479. Status codes returned:
  5480.    0    None of the lists of commands were executed.
  5481.   –1    Invalid expression.
  5482.  
  5483.                            Description
  5484.  
  5485.   Executes the list of commands following the first expression whose
  5486.   value is nonzero. (Null strings are considered zero.) At most one
  5487.   list of commands is executed. You may specify any number of "Else
  5488.   If" clauses. The final Else clause is optional. The return characters
  5489.   (as shown above) or semicolons must appear at the end of each line.
  5490.  
  5491.   The pipe specification (|), conditional command terminators (&& and
  5492.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, ∑∑) may
  5493.   appear following the End and apply to all of the commands in the
  5494.   list.
  5495.  
  5496.   For a definition of expression, see the description of the Evaluate
  5497.   command.
  5498.  
  5499.  
  5500.                              Examples
  5501.  
  5502.   If {Status} == 0
  5503.     Beep 1a,25,200
  5504.   Else
  5505.     Beep -3a,25,200
  5506.   End
  5507.  
  5508.   Produces an audible indication of the success or failure of the preceding
  5509.   command.
  5510.  
  5511.   For window in `Windows`
  5512.     If {window} != {Worksheet} AND {window} != {Active}
  5513.       Close {window}
  5514.     End
  5515.   End
  5516.  
  5517.   Closes all of the open windows except the active window and the Worksheet
  5518.   window. (Refer also to the Windows command.)
  5519.  
  5520.   The following commands, as a script, would implement a trivial case
  5521.   of a general "compile" command:
  5522.  
  5523.   If {1} =~ /≈.c/
  5524.     C {COptions} {1}
  5525.   Else If {1} =~ /≈.p/
  5526.     Pascal {POptions} {1}
  5527.   End
  5528.  
  5529.   If the above commands were saved in a file (say, as "Compile"), both
  5530.   C and Pascal programs could be compiled with the command
  5531.  
  5532.   Compile filename
  5533.  
  5534.  
  5535.                              See also 
  5536.  
  5537.   Evaluate command (for a description of expressions).
  5538.  
  5539.   "Structured Commands" in Chapter 5.
  5540.  
  5541. æKY Lib
  5542. æC           Lib -- combine object files into a library file
  5543.  
  5544. Lib [option…] objectFile…  ≥ progress
  5545.     -d                      # suppress duplicate definition warnings
  5546.     -df deleteFile          # delete modules listed in file deleteFile
  5547.     -dm name[,name]…        # delete external modules and entry points
  5548.     -dn name[,name]…        # delete external names, making them local
  5549.     -f                      # allow FORTRAN-style common data
  5550.     -mf                     # use MultiFinder temporary memory if necessary
  5551.     -o name                 # write object file name (default Lib.Out.o)
  5552.     -p                      # write progress information to diagnostics
  5553.     -rn OldNameA=NewNameA   # change module name(s) OldNameA to NewNameA,
  5554.       [,OldNameB=NewNameB]… #   OldNameB to NewNameB, etc.
  5555.     -sg newSeg=old[,old]…   # merge old segments into new segment
  5556.     -sn oldSeg=newSeg       # change segment name oldSeg to newSeg
  5557.     -sym [On | Full]        # keep symbolic information (default)
  5558.          [Off]              # discard symbolic information, can be followed by:
  5559.             [,NoLabels]     # discard label information
  5560.             [,NoLines]      # discard source line information
  5561.             [,NoTypes]      # discard type information
  5562.             [,NoVars]       # discard variable information
  5563.     -ver N                  # set OMF file version number to N
  5564.     -w                      # suppress warnings
  5565.  
  5566. Status codes returned:
  5567.   0    No problem.
  5568.   1    Syntax error.
  5569.   2    Fatal error.
  5570.  
  5571.                            Description
  5572.  
  5573.   Combines the specified object files into a single file. Input files
  5574.   must have type 'OBJ' .
  5575.  
  5576.   Lib is used for the following:
  5577.  
  5578.     • Combining object code from different languages into a single
  5579.     file.
  5580.  
  5581.     • Combining several object files into a larger object file (a
  5582.     library).
  5583.  
  5584.     • Combining several libraries into a single library, for use
  5585.     in building a particular application or desk accessory. This
  5586.     can greatly improve the performance of the Linker.
  5587.  
  5588.     • Deleting unneeded modules (with the -dm option), changing segmentation
  5589.     (the -sg and -sn options), or changing the scope of a symbol
  5590.     from external to local (the -dn option). (These options are useful
  5591.     when you construct a specialized library for linking a particular
  5592.     program.)
  5593.  
  5594.   Object files that have been processed with Lib result in significantly
  5595.   faster links when compared with the "raw" object files produced by
  5596.   the assembler or compilers.
  5597.  
  5598.   The output of Lib is logically equivalent to the concatenation of
  5599.   the input files, except for the optional renaming, resegmentation,
  5600.   and deletion operations, and the possibility of overriding an external
  5601.   name. The resolution of external names in Lib is identical to Link—in
  5602.   fact, the two programs share the same code for reading object files.
  5603.   Although multiple symbols are reduced to a single symbol, no combining
  5604.   of modules into larger modules is performed, and no cross-module
  5605.   references are resolved. This behavior guarantees that the Linker’s
  5606.   output will be the same size whether or not the output of Lib was
  5607.   used.
  5608.  
  5609.   See "Library Construction" in Chapter 10 of the MPW manual for a detailed 
  5610.   discussion of the behavior and use of Lib.
  5611.  
  5612.  
  5613.                              Examples
  5614.  
  5615.   Lib {CLibraries}≈ -o {CLibraries}CLibrary.o
  5616.  
  5617.   Combines all of the library object files from the {CLibraries} directory
  5618.   into a single library named CLibrary.o. For applications that require
  5619.   most or all of the C library files, using the new CLibrary file will
  5620.   reduce link time.
  5621.  
  5622.  
  5623.                              See also 
  5624.  
  5625.   Link, DumpObj, and DumpCode commands.
  5626.  
  5627.   "Optimizing Your Links" and "Library Construction" in Chapter 10.
  5628.  
  5629.   Appendix H.
  5630.  
  5631. æKY Line
  5632. æC                Line -- find line in the target window
  5633.  
  5634. Line n
  5635.  
  5636. Status codes can be returned by either the Find or the Open commands 
  5637. that make up the Line script:
  5638.   0    No errors.
  5639.   1    Syntax error.
  5640.   2    No target window; other error.
  5641.   3    System error.
  5642.  
  5643.                            Description
  5644.  
  5645.   Line finds line n in the target window. The parameter n is usually
  5646.   an integer, but may be any selection expression. The target window
  5647.   becomes the active (frontmost) window.
  5648.  
  5649.   Line is a script containing these two commands:
  5650.  
  5651.   Find {1} {target} # Find line n in the target window
  5652.  
  5653.   Open {target} # Bring the target window to the top
  5654.  
  5655.  
  5656.                              Examples
  5657.  
  5658.   Line 123
  5659.  
  5660.   Finds line 123 in the target window and makes the target window the
  5661.   new active window.
  5662.  
  5663.   ### Undefined symbol: length
  5664.  
  5665.   File Count.c; Line 75
  5666.  
  5667.   The File and Line commands above are part of an error message produced
  5668.   by the MPW C compiler. The MPW Assembler and MPW Pascal compilers
  5669.   produce errors when using similar formats. You can execute such error
  5670.   messages to find the line that contains the error.
  5671.  
  5672.   The command File is defined as an alias for Target in the Startup
  5673.   file. Thus File opens the specified file as the target window. Line
  5674.   then selects the offending line in the window and brings the window
  5675.   to the front. Notice that the remainder of the error message is a
  5676.   comment.
  5677.  
  5678.  
  5679.                              See also 
  5680.  
  5681.   Find command.
  5682.  
  5683. æKY Link
  5684. æC           Link -- link an application, tool, or resource
  5685.  
  5686. Link [option…] objectFile…  > map ≥ progress
  5687.  -ac alignment           # align code modules to 'n' byte boundaries
  5688.  -ad alignment           # align data modules to 'n' byte boundaries
  5689.  -c creator              # set resourceFile creator (default ????)
  5690.  -d                      # suppress duplicate definition warnings
  5691.  -da                     # desk accessory - add NULL to segment names
  5692.  -f                      # allow FORTRAN-style common data
  5693.  -l                      # write a location map to output
  5694.  -la                     # -l, include anonymous symbols in location map
  5695.  -lf                     # -l, include file and location of definitions
  5696.  -m mainEntry            # use mainEntry as main entry point
  5697.  -ma name=alias          # create an alias for module name
  5698.  -map                    # generate "friendly" link map
  5699.  -mf                     # use MultiFinder temporary memory if necessary
  5700.  -model far              # process 32-bit load-time relocatable references
  5701.  -model near             # prohibit 32-bit load-time relocatable references
  5702.  -msg keyword[,…]        # message options
  5703.      [no]dup             #   (suppress) warnings about duplicate symbols
  5704.      [no]multiple        #   (suppress) multiple undefined symbol reports
  5705.      [no]warn            #   (suppress) warning messages
  5706.  -o resourceFile         # write resourceFile (default Link.Out)
  5707.  -opt [Off]              # disable Object Pascal optimizations (default)
  5708.       [On ]              # enable optimizations
  5709.       [NoBypass]         # enable optimizations, but always dispatch
  5710.          [,Info]         #   write optimization information to diagnostics
  5711.          [,Names]        #   include MacsBug symbols within SelectorProc modules
  5712.  -p                      # write progress information to diagnostics
  5713.  -pg size                # set page size to "size"; max:32K; min: 1024; default: 2048
  5714.  -ra [seg]=attr[,attr…]  # set segment resource attributes:
  5715.      $xx (or) nnn        #   a hex or decimal attribute you figure out
  5716.      resSysHeap          #   or a comma-seperated list of resource
  5717.      resPurgeable        #    attributes by name
  5718.      resLocked           #   
  5719.      resProtected        #   
  5720.      resPreload          #   
  5721.      resChanged          #   (essentially ignored)
  5722.  -rn                     # don't include resource names in resourceFile
  5723.  -rt type[=id]           # set resource type and lowest id (default CODE=0)  
  5724.  -sg newSeg[=old[,old]…] # merge old segments into new segment
  5725.  -sn oldSeg=newSeg       # change segment name oldSeg to newSeg
  5726.  -srt                    # sort global data by "near" and "far" references
  5727.  -ss size                # maximum segment size (default 32760)
  5728.  -sym [Off]              # disable symbolic output (default)
  5729.          [On | Full]     # enable symbolic output, can be followed by:
  5730.          [,NoLabels]     #   omit label information
  5731.          [,NoLines]      #   omit source line information
  5732.          [,NoTypes]      #   omit type information
  5733.          [,NoVars]       #   omit variable information
  5734.  -t type                 # set resourceFile type (default APPL)
  5735.  -uf unrefFile           # write list of unreferenced modules to unrefFile
  5736.  -w                      # suppress warnings
  5737.  -wrap                   # when jump table space is exhausted, put excess jump table 
  5738.                          #   entries in global data space, if available
  5739.  -x crossRefFile         # write cross reference to crossRefFile
  5740.  
  5741. Status codes returned:
  5742.   0    No problem.
  5743.   1    Syntax error.
  5744.   2    Fatal error.
  5745.  
  5746.                            Description
  5747.  
  5748.   Links the specified object files into an application, tool, desk
  5749.   accessory, or driver. The input object files must have type 'OBJ'.
  5750.   Linked segments from the input object files are placed in code resources
  5751.   in the resource fork of the output file. The default output filename
  5752.   is Link.Out, but you can specify other names with the -o option.
  5753.  
  5754.   For detailed information about the linker, and instructions for linking
  5755.   applications, MPW tools, and desk accessories, see Chapters 8 and
  5756.   10 of the MPW manual. The first dialog box of Link’s Commando dialog is 
  5757.   reprinted here for convenience.
  5758.  
  5759.   The linker’s default action is to link an application, placing the
  5760.   output segments into 'CODE' resources. When you link an application,
  5761.   all old 'CODE' resources are deleted before the new 'CODE' resources
  5762.   are written. By default, resources created by the linker are given
  5763.   resource names that are the same as the corresponding segment names.
  5764.   You can change a resource (segment) name with the -sn or -sg options,
  5765.   and you can create unnamed resources with the -rn option.
  5766.  
  5767.   The linker executes in four phases:
  5768.  
  5769.     • Input phase: The linker reads all input files, finds all symbolic
  5770.     references and their corresponding definitions, and constructs
  5771.     a reference graph. Duplicate references are found and warnings
  5772.     are issued.
  5773.  
  5774.     • Analysis phase: The linker allocates and relocates code and
  5775.     data, detects missing references, and builds the jump table.
  5776.     If the -l or -x option is given, Link produces a linker map or
  5777.     cross-reference listing. The linker also eliminates unused code
  5778.     and data.
  5779.  
  5780.     • Output phase: The linker copies linked code segments into code
  5781.     resources in the resource fork of the output file. By default,
  5782.     these resources are given the same names as the corresponding
  5783.     segment names. (The cursor spins backward during this phase.)
  5784.  
  5785.     • Symbolic output phase: Optionally, Link may be used to create
  5786.     the .SYM file for use with SADE.
  5787.  
  5788.  
  5789.                              Examples
  5790.  
  5791.   Link Sample.p.o ∂
  5792.   "{PLibraries}"PInterface.o ∂
  5793.   "{PLibraries}"PasLib.o ∂
  5794.   "{Libraries}"Runtime.o ∂
  5795.   -o Sample ∂
  5796.   -la >Sample.map
  5797.  
  5798.   Links the main program file Sample.p.o with the libraries PInterface.o,
  5799.   PasLib.o, and Runtime.o, placing the output in Sample and placing
  5800.   the Linker map in the file Sample.map. Sample is an application that
  5801.   can be launched from the Finder or executed from MPW.
  5802.  
  5803.   Link -rt MROM=8 -c 'MPS ' -t ZROM -ss 140000 ∂
  5804.   -l > ROMLocListing -o MyROMImage {LinkList}
  5805.  
  5806.   Links the files defined in the Shell variable {LinkList} into a ROM
  5807.   image file, placing the output in the file MyROMImage. The segment
  5808.   size is set to 140,000 bytes, and the ROM is created as a resource
  5809.   'MROM' with ID=8. The file is typed as being created by MPW (creator
  5810.   'MPS '), with file type ZROM. Link’s location-ordered listing is
  5811.   placed in the file ROMLocListing.
  5812.  
  5813.   For additional examples, see "Link" in Chapter 10 and the makefiles
  5814.   in the Examples folders for the languages you are using.
  5815.  
  5816.  
  5817.                              See also 
  5818.  
  5819.   Lib command and Appendix H, "Object File Format."
  5820.  
  5821.   Chapter 8, "The Build Process," and Chapter 10, "Link."
  5822.  
  5823.   The Segment Loader and the Resource Manager chapters in Inside Macintosh.
  5824.  
  5825.   Inside Macintosh, Volume IV, for information on the 128K ROM, the
  5826.   System Folder, and the Finder.
  5827.  
  5828. æKY Loop
  5829. æC                 Loop -- repeat commands until Break
  5830.  
  5831. Loop
  5832.  command…
  5833. End
  5834.  
  5835. Loop returns the status of the last command executed.
  5836.  
  5837.                            Description
  5838.  
  5839.   Executes the enclosed commands repeatedly. The Break command is used
  5840.   to terminate the loop. The Continue command can be used to terminate
  5841.   the current iteration of the loop.
  5842.  
  5843.   The pipe specification (|), conditional command terminators (&& and
  5844.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, and ∑∑)
  5845.   may appear following the End, and apply to all of the commands in
  5846.   the list.
  5847.  
  5848.  
  5849.                              Examples
  5850.  
  5851.   The following script runs a command several times, once for each
  5852.   parameter:
  5853.  
  5854.   ### Repeat - Repeat a command for several parameters ###
  5855.  
  5856.   # Syntax:
  5857.  
  5858.   # Repeat command parameter…
  5859.  
  5860.   #
  5861.  
  5862.   # Execute command once for each parameter in the parameter
  5863.  
  5864.   # list. Options can be specified by including them with
  5865.  
  5866.   # the command name in quotes.
  5867.  
  5868.   #
  5869.  
  5870.   Set cmd {1}
  5871.  
  5872.   Loop
  5873.  
  5874.   Shift
  5875.  
  5876.   Break If {1} ==
  5877.  
  5878.   {cmd} {1}
  5879.  
  5880.   End
  5881.  
  5882.   Notice that Shift is used to step through the parameters, and that
  5883.   Break ends the loop when all parameters have been used.
  5884.  
  5885.  
  5886.                              See also 
  5887.  
  5888.   Break, For, and Continue commands.
  5889.  
  5890.   "Structured Commands" in Chapter 5.
  5891.  
  5892. æKY Make
  5893. æC             Make -- build up-to-date version of a program
  5894.  
  5895. Make [option…] target…   > commands ≥ progress
  5896.  -d name[=value]         # define variable name as value (overrides makefile)
  5897.  -e                      # rebuild everything regardless of dates
  5898.  -f makefile             # read dependencies from makefile (default MakeFile)
  5899.  -p                      # write progress information to diagnostics
  5900.  -r                      # write roots of dependency graph to output
  5901.  -s                      # write structure of target dependencies to output
  5902.  -t                      # touch dates of targets and prerequisites
  5903.  -u                      # identify targets in makefile not reached in build
  5904.  -v                      # write verbose explanations to diagnostics
  5905.  -w                      # suppress warnings
  5906.  -y                      # like -v, but omit announcing up-to-date targets
  5907.  
  5908.  
  5909. Status codes returned:
  5910.   0    Successful completion.
  5911.   1    Parameter or option error.
  5912.   2    Execution error.
  5913.  
  5914.                            Description
  5915.  
  5916.   Generates a set of Shell commands that you can execute to build up-to-date
  5917.   versions of the specified target files. (If no target is specified,
  5918.   the target on the left side of the first dependency rule in the makefile
  5919.   is built.) Make allows you to rebuild only those components of a
  5920.   program that require rebuilding. Make determines which components
  5921.   need rebuilding by reading a makefile. This is a text file that describes
  5922.   dependencies between the components of a program, along with the
  5923.   Shell commands needed to rebuild each component. You can specify
  5924.   makefiles with the -f option. After processing the makefiles, Make
  5925.   writes to standard output the appropriate set(s) of commands needed
  5926.   to rebuild the target(s).
  5927.  
  5928.   See "Format of a Makefile" in Chapter 9 of the MPW manual for a 
  5929.   description of the format of a makefile. The first dialog box of Make’s 
  5930.   Commando dialog is reproduced here for convenience.
  5931.  
  5932.   Make executes in two phases:
  5933.  
  5934.     • In the first phase, Make reads the makefile(s) and creates
  5935.     a file (target) dependency graph. (The "beachball" cursor spins
  5936.     counterclockwise during this phase.)
  5937.  
  5938.     • In the second phase, Make generates the build commands for
  5939.     the target to be built (the cursor spins clockwise). If a target
  5940.     file doesn’t exist or if it depends on files that are out-of-date
  5941.     or newer than the target, Make writes out the appropriate command
  5942.     lines for updating the target file. This process is recursive
  5943.     and "bottom up" so that commands are issued first for those lower-level
  5944.     dependencies that need to be rebuilt.
  5945.  
  5946.   You can execute the generated build commands after Make is done executing.
  5947.  
  5948.  
  5949.                              Examples
  5950.  
  5951.   Make -p -f MakeFile Sample
  5952.  
  5953.   Makes the target file Sample, and prints progress information. Sample’s
  5954.   dependency relations are described in the makefile :AExamples:MakeFile.
  5955.  
  5956.   Sample ƒƒ Sample.r
  5957.       Rez Sample.r -o Sample -a
  5958.       SetFile -a B Sample -c ASMP -t APPL #set bundle bit
  5959.  
  5960.   Sample ƒƒ Sample.r Sample.a.o
  5961.       Link Sample.a.o -o Sample
  5962.  
  5963.   Sample.a.o ƒ Sample.a
  5964.       Asm Sample.a
  5965.  
  5966.   The ƒ (Option-F) character means "is a function of"—that is, the
  5967.   file on the left side depends on the files on the right side. If
  5968.   the files on the right are newer, the subsequent Shell commands are
  5969.   written to standard output. (See Chapter 9 for details.)
  5970.  
  5971.  
  5972.                              See also 
  5973.  
  5974.   "Format of a Makefile" in Chapter 9 for the format of a makefile,
  5975.   examples, and other information about using Make.
  5976.  
  5977.   Makefiles for building sample programs are contained in the Examples
  5978.   folders:
  5979.  
  5980.     • Examples:AExamples:Makefile
  5981.  
  5982.     • Examples:PExamples:Makefile
  5983.  
  5984.     • Examples:CExamples:Makefile
  5985.  
  5986.  
  5987. æKY MakeErrorFile
  5988. æC            MakeErrorFile -- create error message textfile
  5989.  
  5990. MakeErrorFile [option…] [file…]  < file > listing ≥ progress
  5991.  -l                      # write listing to standard output
  5992.  -o file/dir             # output file or directory
  5993.  -p                      # write progress information to diagnostics
  5994.  
  5995. Status codes returned:
  5996.   0    No errors.
  5997.   1    Syntax error.
  5998.   2    Error in processing.
  5999.  
  6000.                            Description
  6001.  
  6002.   MakeErrorFile creates specially formatted error message files used
  6003.   to retrieve the error messages associated with error numbers. The
  6004.   ErrMgr unit in the ToolLibs.o library is used by programs to access
  6005.   the error files created by MakeErrorFile. SysErrs.Err is one such
  6006.   error file; it is used by various MPW tools to get the textual messages
  6007.   associated with Macintosh system error codes. See the documentation
  6008.   on the ErrMgr unit for more information on how error files are accessed.
  6009.  
  6010.  
  6011.                              Examples
  6012.  
  6013.   MakeErrorFile SysErrs -l >SysErrsList
  6014.  
  6015.   Writes an ordered list of system error numbers and messages to the
  6016.   file SysErrsList.
  6017.  
  6018.  
  6019. æKY Mark
  6020. æC                Mark -- assign a marker to a selection
  6021.  
  6022. Mark [-y | -n] selection name [window]
  6023.  -y                      # replace existing marker (avoids dialog)
  6024.  -n                      # don't replace existing marker (avoids dialog)
  6025.  
  6026. Status codes returned:
  6027.   0    No errors.
  6028.   1    Syntax error.
  6029.   2    Error in processing.
  6030.   3    System error.
  6031.  
  6032.                            Description
  6033.  
  6034.   Mark assigns the marker name to the range of text specified by the
  6035.   selection in window. If no window is specified, the command operates
  6036.   on the target window (the second window from the front). The new
  6037.   marker name is included in the Mark menu when window is the current
  6038.   active window. A marker is associated with a logical, as opposed
  6039.   to absolute, range of text. The ranges of markers may overlap, but
  6040.   each marker must have a unique name. Marker names are case sensitive.
  6041.  
  6042.   A dialog box requests confirmation if the marker name conflicts with
  6043.   an existing marker name. The -y or -n option can be used in scripts
  6044.   to avoid this interaction.
  6045.  
  6046.   Deletion and insertion operations affect markers according to these
  6047.   rules:
  6048.  
  6049.     • Any editing outside the range of a marker will not affect the
  6050.     logical range of the marker, where "outside" means that the range
  6051.     of editing changes does not intersect the range of the marker.
  6052.  
  6053.     • Any editing inside the range of a marker will change the logical
  6054.     range of the marker by the amount of the editing change. For
  6055.     example, adding ten characters to the inside of a marker’s range
  6056.     will increase the range of the marker by ten characters. Another
  6057.     way to say this is that a marker has responsibility for all the
  6058.     characters added to (or deleted from) its range.
  6059.  
  6060.     • Any deletion that totally encloses a marker will delete the
  6061.     marker.
  6062.  
  6063.  
  6064.                              Examples
  6065.  
  6066.   Mark § 'Procedure 1'
  6067.  
  6068.   Assigns a marker with the name "Procedure 1" to the current selection
  6069.   in the target window.
  6070.  
  6071.   Limitation It is currently not possible to "Undo" the effects of
  6072.   any editing operations on markers.
  6073.  
  6074.  
  6075.                              See also 
  6076.  
  6077.   Unmark and Markers commands.
  6078.  
  6079.   "Mark Menu" in Chapter 3.
  6080.  
  6081.   "Markers" in Chapter 6.
  6082.  
  6083. æKY Markers
  6084. æC                        Markers -- list markers
  6085.  
  6086. Markers [-q] [window]
  6087.  -q                      # don't quote the marker names
  6088.  
  6089. Status codes returned:
  6090.   0    No errors.
  6091.   1    Syntax error.
  6092.   2    Error in processing.
  6093.   3    System error.
  6094.  
  6095.                            Description
  6096.  
  6097.   Markers prints the names of all markers associated with window. The
  6098.   names are written one per line, and they are ordered from the beginning
  6099.   to the end of the window.
  6100.  
  6101.  
  6102.                              Examples
  6103.  
  6104.   Markers {Target}
  6105.  
  6106.   Lists all markers associated with the target window.
  6107.  
  6108.  
  6109.                              See also 
  6110.  
  6111.   "Mark Menu" in Chapter 3.
  6112.  
  6113.   "Markers" in Chapter 6.
  6114.  
  6115. æKY MatchIt
  6116. æC   MatchIt -- semi-intelligent language sensitive bracket matcher
  6117.  
  6118. MatchIt [-a[sm] | -p[ascal] | -c] [-h] [-l] [-n] [-v] [window]
  6119.  -a[sm]                  # target language is Assembler
  6120.  -p[ascal]               # target language is Pascal
  6121.  -c                      # target language is C
  6122.  -h                      # highlight all characters enclosed by match
  6123.  -l                      # highlight entire lines containing match
  6124.  -n                      # generate error message if no match
  6125.  -v                      # display MatchIt's version number
  6126.  
  6127. Status codes returned:
  6128.   0    Normal termination.
  6129.   1    Parameter or option error.
  6130.   3    Matching delimiter not found (only if -n option specified).
  6131.  
  6132.                            Description
  6133.  
  6134.   Matches C, Pascal, and assembly-language delimiters with their mates
  6135.   in the specified window. The default window is the target window
  6136.   (second from front). The characters highlighted as the current selection1
  6137.   in the window are used as the left delimiter. MatchIt attempts to
  6138.   find the corresponding right mate for the selected delimiter.
  6139.  
  6140.   MatchIt is syntax sensitive, so that it is semi-intelligent about
  6141.   how it finds the matching delimiter. For example, if a Pascal BEGIN
  6142.   is the specified selection, MatchIt finds the proper END that matches
  6143.   it. All commenting conventions, strings, nesting, and so on are taken
  6144.   into account when searching for the end delimiter.
  6145.  
  6146.   The functionality of MatchIt is similar to the Shell editor’s ability
  6147.   to find mates for the characters ( [ { and '' when you double-click
  6148.   any of these characters. However, MatchIt differs from the Shell
  6149.   editor by supporting even more delimiters and using the knowledge
  6150.   of the target language syntax to find the proper match. The following
  6151.   table summarizes all the delimiters supported and for which languages:
  6152.  
  6153.  
  6154.                              Examples
  6155.  
  6156.   matchit  mysource.p
  6157.  
  6158.   For the current selected delimiter in the open window mysource.p,
  6159.   find the delimiter's mate. The language is assumed to be Pascal (because
  6160.   of the .p suffix.). No message is reported and the selection is not
  6161.   changed if the mate cannot be found. Of course, errors are still
  6162.   reported to diagnostic output if the input selection is not a valid
  6163.   Pascal delimiter (according to the table in "Options"). If MatchIt
  6164.   is to be used explicitly, a more general form for its use is shown
  6165.   in this example:
  6166.  
  6167.   matchit  -n  "{target}"
  6168.  
  6169.   For the current selected delimiter in the open target window, find
  6170.   the delimiter’s mate. The "{target}" specification could have been
  6171.   omitted, as it is MatchIt’s default. If explicitly specified, as
  6172.   shown here, it is best to quote it. The language is determined by
  6173.   the window’s name suffix (if present), or by the the selection, if
  6174.   the suffix is not acceptable to MatchIt. An error is reported if
  6175.   the mate cannot be found (-n).
  6176.  
  6177.   While the second example is more general than the first, and either
  6178.   might be useful for Shell scripts (particularly when the -n option
  6179.   is used), the real use for MatchIt is as a generalization of the
  6180.   the Shell editor’s own double-clicking delimiter matching mechanism.
  6181.   The following example illustrates this purpose:
  6182.  
  6183.   addmenu Edit 'Match It/µ' 'matchit  -n -h ∂
  6184.   "{active}"  ≥ "{MPW}"Errors || ∂
  6185.   alert  < "{MPW}"Errors'
  6186.  
  6187.   This example places a MatchIt call into the Edit menu as the command
  6188.   Match It with a command key Option-m (the µ). A selection is made
  6189.   in the current (that is, the {active}) window and the menu command
  6190.   invoked (by pressing Command-Option-m). If the match is found, all
  6191.   characters from the initially selected delimiter to its mate are
  6192.   highlighted (-h). If a match is not found, or if any other errors
  6193.   occur, an alert dialog box appears containing the error message.
  6194.   An auxiliary file, "{MPW}"Errors, is used for this purpose.
  6195.  
  6196.   Of course, you might not be interested in displaying the dialog box
  6197.   because you can see that the selection doesn’t change if there are
  6198.   any errors. Furthermore, you might not want superfluous files laying
  6199.   around ("{MPW}"Errors—although you could create a more elaborate
  6200.   AddMenu command to always delete this file). Thus, you could make
  6201.   the following simplification:
  6202.  
  6203.   addmenu Edit 'Match It/µ' 'matchit  -h  "{active}"  ≥ dev:null'
  6204.  
  6205.   This example places a MatchIt call into the Edit menu but with all
  6206.   errors ignored when the MatchIt command is executed.
  6207.  
  6208.   Limitations MatchIt does not process conditionals (that is, Pascal
  6209.   $ifc, C #if, and so on) during its scan except to find matching pairs.
  6210.   This might confuse MatchIt’s scanning process. Similarily, C macros
  6211.   and "\" continuations may also confuse MatchIt.
  6212.  
  6213.   MatchIt only finds a right delimiter to the specified left delimiter.
  6214.   Right-to-left matching is not supported.
  6215.  
  6216. æKY MergeBranch
  6217. æC        MergeBranch -- merge a branch revision onto the trunk
  6218.  
  6219. MergeBranch file…
  6220.  
  6221. Status codes returned:
  6222.   0    No Errors.
  6223.   1    Syntax Error.
  6224.   2    Error in Processing.
  6225.   3    System Error.
  6226.  
  6227.                            Description
  6228.  
  6229.   Merge the branch revision of the HFS file file onto the trunk. The
  6230.   file must belong to a currently mounted project and must be a branch
  6231.   revision (that is, the revision number contains one or more letters).
  6232.  
  6233.   MergeBranch uses the ProjectInfo command to determine what project
  6234.   file belongs to and whether file is in fact a branch revision. If
  6235.   all of the file's revisions are older than the branch, the branch
  6236.   will be checked in as the latest trunk revision. Otherwise MergeBranch
  6237.   checks out the latest revision on the trunk and calls CompareFiles
  6238.   to allow the user to manually cut and paste changes from the branch
  6239.   into the trunk revision. When done, the user can check the modified
  6240.   trunk revision back into the project.
  6241.  
  6242.   MergeBranch uses the CompareFiles script.
  6243.  
  6244.  
  6245.                              Examples
  6246.  
  6247.   MergeBranch file.c
  6248.  
  6249.   This example merges the branch revision in the file "file.c" onto
  6250.   the trunk.
  6251.  
  6252.   AddMenu Project 'Merge Branch' 'Merge Branch {Active} ∑∑ {WorkSheet}'
  6253.  
  6254.   This example adds MergeBranch to the Project menu and allows you
  6255.   to merge branch revisions onto the trunk.
  6256.  
  6257.  
  6258.                              See also 
  6259.  
  6260.   CompareFiles.
  6261.  
  6262. æKY ModifyReadOnly
  6263. æC  ModifyReadOnly -- enables a read-only Projector file to be edited
  6264.  
  6265. ModifyReadOnly file …
  6266.  
  6267. Status codes returned:
  6268.   0    No errors.
  6269.   1    Syntax error.
  6270.   2    Error in processing.
  6271.  
  6272.                            Description
  6273.  
  6274.   Write-enable a file that has been checked out as read-only. After
  6275.   executing this command on a file, the modified read-only icon is
  6276.   displayed in the window.
  6277.  
  6278.   This command is most useful on those rare occasions when you need
  6279.   to modify a read-only file. For example, suppose you have taken a
  6280.   number of modifiable files home. You may have also brought along
  6281.   certain read-only copies of files that you did not expect to modify,
  6282.   but once you get into your work at home you discover that you do,
  6283.   after all, need to make changes in these files.
  6284.  
  6285.   Note that this command takes only a single file for a parameter.
  6286.   This "feature" was intentional so that this command would not be
  6287.   overused.
  6288.  
  6289.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6290.   symbols used in Projector commands.
  6291.  
  6292.  
  6293.                              Examples
  6294.  
  6295.   Suppose file.c is checked out as read-only. You can write-enable
  6296.   it by using the ModifyReadOnly command:
  6297.  
  6298.   ModifyReadOnly file.c
  6299.  
  6300.   ProjectInfo :file.c -s
  6301.  
  6302.   The ProjectInfo command writes the following to standard output:
  6303.  
  6304.   file.c,5*
  6305.  
  6306.   Notice that an asterisk appears after the revision number when you
  6307.   get information about modified read-only files.
  6308.  
  6309.  
  6310.                              See also 
  6311.  
  6312.   CheckIn, CheckOut, CheckOutDir.
  6313.  
  6314. æKY Mount
  6315. æC                        Mount -- mount volumes
  6316.  
  6317. Mount drive…
  6318.  
  6319. Status codes returned:
  6320.   0    The disk was mounted.
  6321.   1    Syntax error.
  6322.   2    An error occurred.
  6323.  
  6324.                            Description
  6325.  
  6326.   Mounts the disks in the specified drives, making them accessible
  6327.   to the file system. Drive is the drive number.
  6328.  
  6329.   Mounting is normally automatic when a disk is inserted. The Mount
  6330.   command is needed for mounting multiple hard disks, which cannot
  6331.   be "inserted," or for volumes that have been unmounted via the Unmount
  6332.   command.
  6333.  
  6334.  
  6335.                              Examples
  6336.  
  6337.   Mount 1
  6338.  
  6339.   Mounts the disk in drive 1 (the internal drive).
  6340.  
  6341.  
  6342.                              See also 
  6343.  
  6344.   Unmount and Volumes commands.
  6345.  
  6346. æKY MountProject
  6347. æC                    MountProject -- mount projects
  6348.  
  6349. MountProject ([-s] [-pp] [-q] [-r]) | [Project]
  6350.  -s                      # print names only, not commands
  6351.  -pp                     # list mounted projects using project paths
  6352.  -q                      # don't quote names with special characters
  6353.  -r                      # list projects recursively
  6354.  
  6355. Status codes returned:
  6356.   0    No errors.
  6357.   1    Syntax error.
  6358.   2    Error in processing.
  6359.   3    System error.
  6360.  
  6361.                            Description
  6362.  
  6363.   MountProject mounts (establishes a connection to) the specified project.
  6364.   Project is the HFS path of the project directory for the project.
  6365.   Once a project is mounted, that project and all its subprojects can
  6366.   be accessed.
  6367.  
  6368.   MountProject commands typically appear in the UserStartup file, a
  6369.   script, or an AddMenu to automatically mount the projects you typically
  6370.   access.
  6371.  
  6372.   If project is omitted, a list of all root projects is written to
  6373.   standard output in the form of MountProject commands.
  6374.  
  6375.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6376.   symbols used in Projector commands.
  6377.  
  6378.  
  6379.                              Examples
  6380.  
  6381.   MountProject FS:Zoom
  6382.   MountProject HD:localProjects:Test
  6383.  
  6384.   These commands mount the projects Zoom and Test.
  6385.  
  6386.   MountProject
  6387.   MountProject FS:MPW
  6388.   MountProject HD:localProjects:sort
  6389.  
  6390.   To obtain a list of the current root projects, execute the MountProject
  6391.   command without parameters.
  6392.  
  6393.  
  6394.                              See also 
  6395.  
  6396.   UnmountProject, Project, CheckOutDir.
  6397.  
  6398. æKY Move
  6399. æC                  Move -- move files and directories
  6400.  
  6401. Move [-y | -n | -c] [-p] name… target  ≥ progress
  6402.  -y                      # overwrite target files (avoids dialog)
  6403.  -n                      # don't overwrite target files (avoids dialog)
  6404.  -c                      # cancel if conflict occurs (avoids dialog)
  6405.  -p                      # write progress information to diagnostics
  6406.  
  6407. Status codes returned:
  6408.   0    All objects were moved.
  6409.   1    Syntax error.
  6410.   2    An error occurred during the move.
  6411.   4    Cancel was selected or implied with the -c option.
  6412.  
  6413.                            Description
  6414.  
  6415.   Moves name to targetName. (Name and targetName are file or directory
  6416.   names.) If targetName is a directory, one or more objects (files
  6417.   and/or directories) are moved into that directory. If targetName
  6418.   is a file or doesn’t exist, file or directory name replaces targetName.
  6419.   In either case, the old objects are deleted. Moved objects retain
  6420.   their current creation and modification dates.
  6421.  
  6422.   If a directory is moved, its contents, including all subdirectories,
  6423.   are also moved. No directory moved can be a parent of targetName.
  6424.  
  6425.   A dialog box requests a confirmation if the move would overwrite
  6426.   an existing file or folder. The -y, -n, or -c option can be used
  6427.   to avoid this interaction.
  6428.  
  6429.  
  6430.                              Examples
  6431.  
  6432.   Move Startup Suspend Resume Quit {SystemFolder}
  6433.  
  6434.   Moves the four files from the current directory to the System Folder.
  6435.  
  6436.   Move File ::
  6437.  
  6438.   Moves File from the current directory to the enclosing (parent) directory.
  6439.  
  6440.   Move -y File1 File2
  6441.  
  6442.   Moves File1 to File2, overwriting File2 if it exists. (This is the
  6443.   same as renaming the file.)
  6444.  
  6445.  
  6446.                              See also 
  6447.  
  6448.   Duplicate and Rename commands.
  6449.  
  6450.   "File and Window Names" in Chapter 4.
  6451.  
  6452.   "Filename Generation" in Chapter 5.
  6453.  
  6454. æKY MoveWindow
  6455. æC                 MoveWindow -- move window to h,v location
  6456.  
  6457. MoveWindow [h v] [-i] [window]
  6458.  h                       # horizontal position of top left corner
  6459.  v                       # vertical position of top left corner
  6460.  -i                      # ignore positioning errors
  6461.  
  6462. Status codes returned:
  6463.   0    No errors.
  6464.   1    Syntax error (error in parameters).
  6465.   2    The specified window does not exist.
  6466.   3    The h v location specified is invalid.
  6467.  
  6468.                            Description
  6469.  
  6470.   Moves the upper-left corner of the specified window to the location
  6471.   (h v), where h and v are horizontal and vertical integers, respectively.
  6472.   Use a space to separate the numbers h and v on the command line.
  6473.  
  6474.   The coordinates (0,0) are located at the left side of the screen
  6475.   at the bottom of the menu bar. If the location specified would place
  6476.   the window’s title bar entirely off the visible screen, an error
  6477.   is returned. (The -i option overrides the error.) If no window is
  6478.   specified, the target window (the second window from the front) is
  6479.   assumed. If no location is specified, the specified window’s location
  6480.   is returned without any effect on the window.
  6481.  
  6482.  
  6483.                              Examples
  6484.  
  6485.   MoveWindow 72 72
  6486.  
  6487.   Moves the target window’s upper-left corner to a point approximately
  6488.   one inch in from the upper-left corner of the screen, and one inch
  6489.   below the bottom of the menu bar. (There are about 72 pixels per
  6490.   inch on the Macintosh display screen.)
  6491.  
  6492.   MoveWindow
  6493.  
  6494.   Returns MoveWindow 72 72 when executed after the above example.
  6495.  
  6496.   MoveWindow 0 0 {Worksheet}
  6497.  
  6498.   Moves the Worksheet window to the upper-left corner of the screen
  6499.   (below the menu bar).
  6500.  
  6501.  
  6502.                              See also 
  6503.  
  6504.   SizeWindow, StackWindows, RotateWindows, TileWindows, and ZoomWindow
  6505.   commands.
  6506.  
  6507. æKY NameRevisions
  6508. æC                NameRevisions -- define a symbolic name
  6509.  
  6510. NameRevisions [-u User] [-project Project] [-public |private | -b] [-r]
  6511.      [[-only] | name [[-expand] [-s] | [-replace] [-dynamic] [names… | -a]]]
  6512.  -u user                 # name of current user
  6513.  -private                # create a private name
  6514.  -project project        # name of project that contains the revisions
  6515.  -public                 # create a public name
  6516.  -b                      # print both public and private names
  6517.  -expand                 # evaluate names to revision level before printing
  6518.  -only                   # only print the names, not the associated revisions
  6519.  -replace                # completely overwrite the previous definition of name
  6520.  -dynamic                # evaluate names to revision level when using not defining
  6521.  -r                      # recursively execute NameRevisions starting with current project
  6522.  -s                      # print a single name per line
  6523.  -a                      # all the files in the project
  6524.  
  6525. Status codes returned:
  6526.   0    No errors.
  6527.   1    Syntax error.
  6528.   2    Error in processing.
  6529.   3    System error.
  6530.  
  6531.                            Description
  6532.  
  6533.   Create a symbolic name to represent a set of revisions under Projector.
  6534.   Subsequently, when name is used in Projector commands, its value,
  6535.   names, is substituted in its place. Symbolic names are kept on a
  6536.   per-project basis and can be composed of filenames, revisions, branches,
  6537.   and other defined symbolic names. A symbolic name can include only
  6538.   one revision per file. The first character of a Name cannot be a
  6539.   digit (0–9). Also, commas, greater-than or less-than signs, (<, <,
  6540.   > >), or hyphens (-) are not allowed anywhere in a Name. Names are
  6541.   not case sensitive.
  6542.  
  6543.   If names is missing, the definition for name is listed. If name is
  6544.   missing, then NameRevisions lists all symbolic names in the project.
  6545.   In either case, the output is in the form of NameRevisions commands.
  6546.  
  6547.   By default, if names currently refers to a file listed in name, the
  6548.   revision for the file in name is modified to be the revision associated
  6549.   with the file in names. If there is a file in names which is not
  6550.   currently referred to by name, that file and revision is appended
  6551.   to name. To replace the definition of name, include the
  6552.  
  6553.   -replace option.
  6554.  
  6555.   The default is to create a private symbolic name. Include the -public
  6556.   option to make the symbolic name available to all users. You can
  6557.   add definitions for private symbolic names to UserStartup. Public
  6558.   symbolic name are stored with the project so they need to be defined
  6559.   only once. Do not put public symbolic name definitions in UserStartup.
  6560.  
  6561.   Projector checks for various errors both when a symbolic name is
  6562.   defined and when it is used. Errors include referring to a nonexistent
  6563.   file or referring to more than one revision in a file.
  6564.  
  6565.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6566.   symbols used in Projector commands.
  6567.  
  6568.  
  6569.                              Examples
  6570.  
  6571.   Assuming the latest revisions of the files file.c and interactive.c
  6572.   are 9 and 13 respectively, the first example defines a symbolic name
  6573.   "Work" that always expands to the files file.c,9 and interactive.c,13.
  6574.  
  6575.   NameRevisions Work file.c interactive.c
  6576.  
  6577.   The following command:
  6578.  
  6579.   CheckOut Work
  6580.  
  6581.   Is equivalent to:
  6582.  
  6583.   CheckOut file.c,9 interactive.c,13
  6584.  
  6585.   By omitting the Names parameter, the next NameRevisions command generates
  6586.   the current definition of Work.
  6587.  
  6588.   NameRevisions Work
  6589.   NameRevisions Work file.c,9 interactive.c,13
  6590.  
  6591.   The -dynamic is an important option. The following two commands illustrate
  6592.   its function:
  6593.  
  6594.   NameRevisions fred file.c
  6595.   NameRevisions -dynamic fred file.c
  6596.  
  6597.   The first command defines a symbolic name "fred" that always expands
  6598.   to the latest revision of file.c when fred was defined. The second
  6599.   example expands to the latest revision at the time of use. If the
  6600.   latest revision of file.c at the time fred was defined was 7 and
  6601.   the current latest revision is 9, the second NameRevisions command
  6602.   is equivalent to
  6603.  
  6604.   NameRevisions fred file.c,9
  6605.  
  6606.   The next command creates the symbolic name "file.c" that expands
  6607.   to the second revision off the first branch off the 1.1 revision
  6608.   of file.c.
  6609.  
  6610.   NameRevisions file.c file.c,1.1a2
  6611.  
  6612.   The command
  6613.  
  6614.   CheckOut file.c
  6615.  
  6616.   checks out revision 1.1a2 of file.c. The next example creates a Name
  6617.   "file.c" that expands to the latest version of the first branch off
  6618.   the 1.1 revision of file.c.
  6619.  
  6620.   NameRevisions -dynamic file.c file.c,1.1a
  6621.  
  6622.   So the checkout command
  6623.  
  6624.   CheckOut file.c
  6625.  
  6626.   will check out the latest revision on the first branch off revision
  6627.   1.1 of file.c.
  6628.  
  6629.   The next example defines all the latest revisions in the project
  6630.   Kerfroodi to be part of "v1.0 B1". Because this a global name, all
  6631.   users accessing the Kerfroodi project will be able to use the name
  6632.   "v1.0 B1".
  6633.  
  6634.   NameRevisions -public "vB1 1.0" -project Kerfroodi -a
  6635.  
  6636.   The name "BetaRelease" is defined recursively for all projects within
  6637.   the Zoom project:
  6638.  
  6639.   NameRevisions -project Zoom∫ -r "BetaRelease" -a
  6640.  
  6641.   Its behavior is the same as executing the following commands individually:
  6642.  
  6643.   NameRevisions -project Zoom "BetaRelease" -a
  6644.   NameRevisions -project Zoom∫Vroom "BetaRelease" -a
  6645.   NameRevisions -project Zoom∫Utilities "BetaRelease" -a
  6646.   NameRevisions -project Zoom∫Utilities∫Port "BetaRelease" -a
  6647.   ...
  6648.  
  6649.  
  6650.                              See also 
  6651.  
  6652.   ProjectInfo, DeleteNames.
  6653.  
  6654. æKY New
  6655. æC                       New -- open a new window
  6656.  
  6657. New [name…]
  6658.  
  6659. Status codes returned:
  6660.   0    No errors.
  6661.   1    Syntax error (error in parameters).
  6662.   2    Unable to complete operation; a file with the specified name already exists.
  6663.   3    System error.
  6664.  
  6665.                            Description
  6666.  
  6667.   Opens a new window as the active (frontmost) window. If name is not
  6668.   specified, the Shell generates a unique name for the new window,
  6669.   of the form "Untitled-n", where n is a decimal number. If name already
  6670.   exists, an error results.
  6671.  
  6672.   You can use New to open several new windows by specifying a list
  6673.   of names separated by spaces. Note that New differs from Open -n
  6674.   by returning an error if the file already exists, whereas Open -n
  6675.   either opens an existing file or creates a new file.
  6676.  
  6677.   If the Shell variable {NewWindowRect} is defined, the windows are
  6678.   opened to that size and location.
  6679.  
  6680.  
  6681.                              Examples
  6682.  
  6683.   New
  6684.  
  6685.   Opens a new window with a Shell-generated name.
  6686.  
  6687.   New Test.a Test.p Test.c
  6688.  
  6689.   Creates three windows called Test.a, Test.p, and Test.c.
  6690.  
  6691.  
  6692.                              See also 
  6693.  
  6694.   Open command.
  6695.  
  6696. æKY Newer
  6697. æC             Newer -- compare modification dates of files
  6698.  
  6699. Newer [-c] [-e] [-q] file… target > newer
  6700.  -c               # compare creation dates
  6701.  -e               # report names that have same (equal) mod date as target
  6702.  -q               # don't quote file names with special characters
  6703.  
  6704. Status codes returned:
  6705.   0    No error.
  6706.   1    Syntax error.
  6707.   2    File not found.
  6708.  
  6709.                            Description
  6710.  
  6711.   Compares the modification dates of name and target. Files that have
  6712.   a more recent modification date than target have their names written
  6713.   to standard output. If the target is a nonexistent file or directory,
  6714.   all names that exist are considered newer than the target.
  6715.  
  6716.  
  6717.                              Examples
  6718.  
  6719.   Newer main.c main.c.bak
  6720.  
  6721.   Writes out main.c if its modification date is more recent than its
  6722.   backup.
  6723.  
  6724.   Newer HD:Source:≈.c HD:TimeStamp
  6725.  
  6726.   Writes to the screen all the source files in the Source directory
  6727.   that have been modified since the modification date of TimeStamp.
  6728.  
  6729.   If `Newer main.c main.c.bak`
  6730.     Duplicate main.c main.c.bak
  6731.   End
  6732.  
  6733.   Makes a backup copy of main.c only if it has been modified since
  6734.   the last backup was made.
  6735.  
  6736.   If "`Newer File.c File.h File.c.o`"
  6737.     C File.c -o file.c.o
  6738.   End
  6739.  
  6740.   Rebuilds the source file file.c if either file.c or file.h has been
  6741.   modified since file.c.o was last built.
  6742.  
  6743. æKY NewFolder
  6744. æC                   NewFolder -- create a new folder
  6745.  
  6746. NewFolder name…
  6747.  
  6748. Status codes returned:
  6749.   0    Folders were created for each name listed.
  6750.   1    Syntax error.
  6751.   2    An error occurred.
  6752.   3    Attempt to use NewFolder on a non-HFS volume.
  6753.  
  6754.                            Description
  6755.  
  6756.   Creates new directories with the names specified. Any parent directories
  6757.   included in the name specification must already exist.
  6758.  
  6759.     • Note: This command can be used only on hierarchical file system
  6760.     (HFS) disks.
  6761.  
  6762.  
  6763.                              Examples
  6764.  
  6765.   NewFolder Memos
  6766.  
  6767.   Creates Memos as a subdirectory of the current directory.
  6768.  
  6769.   NewFolder Parent :Parent:Kid
  6770.  
  6771.   Creates Parent as a subdirectory of the current directory, and Kid
  6772.   as a subdirectory of Parent.
  6773.  
  6774. æKY NewProject
  6775. æC                  NewProject -- create a new project
  6776.  
  6777. NewProject -w | -close | ([-u user] [-cs comment | -cf file] project)
  6778.  -cf file                # the comment is contained in file.
  6779.  -close                  # close the New Project window
  6780.  -cs comment             # a short description of the project
  6781.  -w                      # open the New Project window
  6782.  -u user                 # name of current user
  6783.  
  6784. Status codes returned:
  6785.   0    No errors.
  6786.   1    Syntax error.
  6787.   2    Error in processing.
  6788.   3    System error.
  6789.  
  6790.                            Description
  6791.  
  6792.   NewProject creates a project under control of Projector. A project
  6793.   directory is created to store the files, subprojects, and other information
  6794.   related to the project. The name of the directory is the name of
  6795.   the project.
  6796.  
  6797.   If project is a project pathname (such as MPW∫Tools∫Enterprise),
  6798.   Projector creates Enterprise as a subproject of the existing MPW∫Tools
  6799.   project. In this case MPW∫Tools must be a mounted project (see the
  6800.   MountProject command).
  6801.  
  6802.   If project is a leafname (such as Enterprise), project directory
  6803.   Enterprise is created in the current directory.
  6804.  
  6805.   Finally, if project is a partial or full HFS pathname (such as :Work:Enterprise
  6806.   or FS:Projects:Enterprise), the project Enterprise is created in
  6807.   the HFS location specified.
  6808.  
  6809.   Add a MountProject command to the UserStartup file, a script, or
  6810.   AddMenu to easily mount the new project.
  6811.  
  6812.   The checkout directory is initially set to the current directory
  6813.   (:). To change the checkout directory, refer to the CheckOutDir command.
  6814.  
  6815.   To add files to the new project, use the CheckIn command (with the
  6816.   -new option) or the Check In window.
  6817.  
  6818.   See Chapter 7 of the MPW manual for complete definitions of the terms and
  6819.   symbols used in Projector commands.
  6820.  
  6821.  
  6822.                              Examples
  6823.  
  6824.   The following command creates a project Enterprise in the current
  6825.   directory. No comment is saved with the project, but you can add
  6826.   one later by selecting the project in the Check Out window's /Info
  6827.   view.
  6828.  
  6829.   NewProject Enterprise
  6830.  
  6831.   The next example creates a project Zoom in the FS:work:Zoom. The
  6832.   -cf option indicates that the comment for the new project is contained
  6833.   in the file Info.
  6834.  
  6835.   NewProject FS:work:Zoom -cf Info
  6836.  
  6837.   Finally, given that the project Enterprise∫Utilities exists and has
  6838.   been mounted using the MountProject command, the next command creates
  6839.   a Zoom project in the Enterprise∫Utilities project. In this case
  6840.   you don’t need to add a MountProject command to UserStartup, but
  6841.   you may want to add a CheckOutDir command to set the checkout directory.
  6842.  
  6843.   NewProject Enterprise∫Utilities∫Zoom -cs ∂
  6844.   "Upgrade Zoom utility"
  6845.  
  6846.  
  6847.                              See also 
  6848.  
  6849.   CheckOutDir, MountProject, Project.
  6850.  
  6851. æKY Open
  6852. æC                  Open -- open file(s) in window(s)
  6853.  
  6854. Open [-n | -r] [-t] [name…]
  6855.  -n                      # open new file (default name Untitled)
  6856.  -r                      # open file for read-only use
  6857.  -t                      # open file as the target window
  6858.  
  6859. Status codes returned:
  6860.   0    No errors.
  6861.   1    Error in parameters.
  6862.   2    Unable to complete operation; specified file not found.
  6863.   3    System error.
  6864.  
  6865.                            Description
  6866.  
  6867.   Opens a file as the active (frontmost) window. If name is not specifed,
  6868.   StdFile’s GetFile routine is called, allowing you to use a dialog
  6869.   box to choose a file. If name is already open as a window, that window
  6870.   becomes the active (frontmost) window.
  6871.  
  6872.  
  6873.                              Examples
  6874.  
  6875.   Open
  6876.  
  6877.   Displays StdFile from which to choose a file to open.
  6878.  
  6879.   Open -r -t Test.a
  6880.  
  6881.   Opens the file Test.a as the target window, read-only.
  6882.  
  6883.   Open ≈.a
  6884.  
  6885.   Opens all the files that end with ".a".
  6886.  
  6887.  
  6888.                              See also 
  6889.  
  6890.   Target, New, and Close commands.
  6891.  
  6892. æKY OrphanFiles
  6893. æC  OrphanFiles -- remove Projector information from a list of files
  6894.  
  6895. OrphanFiles file…
  6896.  
  6897. Status codes returned:
  6898.   0    No errors.
  6899.   1    Syntax error.
  6900.   2    Error in processing.
  6901.  
  6902.                            Description
  6903.  
  6904.   Remove the 'CKID' resource from file(s). This removes the identification
  6905.   information from the file that Projector uses to uniquely identify it.
  6906.  
  6907.     • Warning Once the projector information is removed from a file,
  6908.     you cannot check the file back into the Project as a checked-out
  6909.     file.
  6910.  
  6911.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6912.   symbols used in Projector commands.
  6913.  
  6914.  
  6915.                              Examples
  6916.  
  6917.   Suppose file.c and interactive.c belong to a project that has been
  6918.   deleted. We can remove the Projector information from them (so that
  6919.   they can be used for other purposes) with the command
  6920.  
  6921.   OrphanFiles file.c interactive.c
  6922.  
  6923.  
  6924.                              See also 
  6925.  
  6926.   TransferCkid.
  6927.  
  6928. æKY Parameters
  6929. æC                    Parameters -- write parameters
  6930.  
  6931. Parameters [parameter…]  > parameters
  6932.  
  6933. Status codes returned:   
  6934.   0    no errors is always returned.
  6935.  
  6936.                            Description
  6937.  
  6938.   The Parameters command writes its parameters, including its name,
  6939.   to standard output. The parameters are written one per line, and
  6940.   each is preceded by its parameter number (in braces) and a blank.
  6941.   This command is useful for checking the results of variable substitution,
  6942.   command substitution, quoting, blank interpretation, and filename
  6943.   generation.
  6944.  
  6945.  
  6946.                              Examples
  6947.  
  6948.   Parameters One Two "and Three"
  6949.  
  6950.   Writes the following four lines to standard output:
  6951.  
  6952.   {0} Parameters
  6953.   {1} One
  6954.   {2} Two
  6955.   {3} and Three
  6956.  
  6957.   Recall that "…" and '…' quotation marks are removed before parameters
  6958.   are passed to commands.
  6959.  
  6960.  
  6961.                              See also 
  6962.  
  6963.   Echo and Quote commands.
  6964.  
  6965.   "Parameters to Scripts" in Chapter 5.
  6966.  
  6967. æKY Pascal
  6968. æC                      Pascal -- Pascal compiler
  6969.  
  6970. Pascal [option…] [file…]  < file ≥ progress
  6971.     -b                   # generate A5 references for procedure addresses
  6972.     -c                   # syntax check only, don't create object file
  6973.     -clean               # erase all symbol table resources
  6974.     -d name=(TRUE|FALSE) # set compile time variable name
  6975.     -e file              # write errors to file
  6976.     -forward             # allow only explicit forward and external object declarations
  6977.     -h                   # suppress error messages regarding unsafe handles
  6978.     -i directory,…       # search for includes in directory,…
  6979.     -k directory         # create symbol table resource files in directory
  6980.     -m                   # allow greater than 32K globals by using 32 bit
  6981.     -mbg ch8             # include v2.0 compatible MacsBug symbols
  6982.     -mbg full            # include full (untruncated) symbols for MacsBug
  6983.     -mbg off             # don't include symbols for MacsBug
  6984.     -mbg number          # include MacsBug symbols truncated to length 
  6985.                          # number
  6986.     -mc68020             # generate MC68020 code 
  6987.     -mc68881             # generate MC68881 code for floating point operations
  6988.      -model farCode|     # generate load-time relocatable 32-bit references for
  6989.          farData|far     #   code, data, or both
  6990.      -model nearCode|    # generate 16-bit references for code, data, or both 
  6991.          nearData|near   #   (the default)
  6992.     -n                   # generate separate global data modules for better allocation
  6993.     -noload              # don't use or create any symbol table resources
  6994.     -o objname           # generate code in file or directory objname
  6995.     -only name…          # only generate code for named modules
  6996.     -ov                  # generate code to test for overflow
  6997.     -opt off             # don't apply code optimizations
  6998.     -opt on | full       # choose level of code optimization (full is default);
  6999.                          #   can modify with [,nopeep] [,nostatic]
  7000.     -p                   # write progress information to diagnostics
  7001.     -r                   # don't generate range checking code
  7002.     -rebuild             # rebuild all symbol table resources
  7003.     -sym off             # don't generate SADE records
  7004.     -sym on | full       # generate SADE records; can modify with [,nolines] [,notypes] [,novars]
  7005.     -t                   # write compilation time to diagnostics
  7006.     -u                   # initialize all data to $7267 for debugging use
  7007.     -w                   # don't perform peephole optimization
  7008.     -y directory         # create temporary files in directory
  7009.  
  7010. Status codes returned:
  7011.   0    Successful completion.
  7012.   1    Error in parameters.
  7013.   2    Compilation halted.
  7014.  
  7015.                            Description
  7016.  
  7017.   Compiles the specified Pascal source files (programs or units). You
  7018.   can specify zero or more filenames. Each file is compiled separately—compiling
  7019.   file Name .p creates object file Name .p.o. By convention, Pascal
  7020.   source filenames end in a ".p" suffix.
  7021.  
  7022.   See the MPW 3.0 Pascal Reference for details of the language definition.
  7023.  
  7024.  
  7025.                              Examples
  7026.  
  7027.   Pascal Sample.p
  7028.  
  7029.   Compiles the Sample program provided in the PExamples folder.
  7030.  
  7031.   Pascal File1.p File2.p -r
  7032.  
  7033.   Compiles File1.p and File2.p, producing object files File1.p.o and
  7034.   File2.p.o but performing no range checking.
  7035.  
  7036.     • Note: Listing files are not produced directly by the compiler.
  7037.     Refer to the PasMat and PasRef tools.
  7038.  
  7039.   Availability The MPW Pascal compiler is available as a separate Apple
  7040.   product.
  7041.  
  7042.  
  7043.                              See also 
  7044.  
  7045.   PasMat and PasRef commands.
  7046.  
  7047.   MPW 3.0 Pascal Reference.
  7048.  
  7049. æKY PasMat
  7050. æC                  PasMat -- Pasca programs formatter
  7051.  
  7052. PasMat [option…] [input [output]]  < input > output ≥ progress
  7053.  -a                      # set a-  disable CASE label bunching
  7054.  -b                      # set b+  enable IF bunching
  7055.  -body                   # set body+ to disable indenting procedure bodies
  7056.  -c                      # set c+  suppress Return before BEGIN
  7057.  -d                      # set d+  use {…} comment delimiters
  7058.  -e                      # set e+  capitalize identifiers
  7059.  -entab                  # replace multiple blanks with tabs
  7060.  -f                      # set f-  disable formatting
  7061.  -g                      # set g+  group assignment and call statements
  7062.  -h                      # set h-  disable FOR, WHILE, WITH bunching
  7063.  -i directory,…          # search for includes in directory,…
  7064.  -in                     # set in+ process includes
  7065.  -k                      # set k+  indent statements between BEGIN and END
  7066.  -l                      # set l+  literally copy reserved words, identifiers
  7067.  -list file              # write listings to file
  7068.  -n                      # set n+  group formal parameters
  7069.  -o width                # set output line width (default 80)
  7070.  -p                      # write progress information to diagnostics
  7071.  -pattern -old-new-      # modify include names, changing old to new
  7072.  -q                      # set q+  no special ELSE IF formatting
  7073.  -r                      # set r+  upper case reserved words
  7074.  -rec                    # set rec+ to indent field lists under defined id
  7075.  -s file                 # substitute identifiers based on pairs in file
  7076.  -t tab                  # set output tab setting (default 2)
  7077.  -u                      # rename identifiers to match first occurence
  7078.  -v                      # set v+  put THEN on separate line
  7079.  -w                      # set w+  upper case identifiers
  7080.  -x                      # set x+  suppress space around operators
  7081.  -y                      # set y+  suppress space around :=
  7082.  -z                      # set z+  suppress space after commas
  7083.  -:                      # set :+  align colons in VAR declarations
  7084.  -@                      # set @+  multiple CASE tags on separate lines
  7085.  -∂#                     # set #+  smart grouping of assignments and calls
  7086.  -_                      # set _+  delete _ from identifiers
  7087.  
  7088. Status codes returned:
  7089.   0    Normal termination.
  7090.   1    Parameter or option error.
  7091.  
  7092.                            Description
  7093.  
  7094.   Reformats Pascal source code into a standard format, suitable for
  7095.   printouts or compilation. PasMat accepts full programs, external
  7096.   procedures, blocks, and groups of statements.
  7097.  
  7098.     • Note: A syntactically incorrect program causes PasMat to abort.
  7099.     If this happens, the generated output will contain the formatted
  7100.     source up to the point of the error.
  7101.  
  7102.   PasMat options let you do the following:
  7103.  
  7104.     • Convert a program to uniform case conventions.
  7105.  
  7106.     • Indent a program to show its logical structure, and adjust
  7107.     lines to fit into a specified line length.
  7108.  
  7109.     • Change the comment delimiters ( * * ) to { } .
  7110.  
  7111.     • Remove the underscore character ( _ ) from identifiers, rename
  7112.     identifiers, or change their case.
  7113.  
  7114.     • Format include files named in MPW Pascal include directives.
  7115.  
  7116.   PasMat specifications can be made through PasMat options or through
  7117.   special formatter directives, which resemble Pascal compiler directives,
  7118.   and are inserted into the source file as Pascal comments. PasMat’s
  7119.   default formatting is straightforward and does not require you to
  7120.   use any options. The best way to find out how PasMat formats something
  7121.   is to try out a small example.
  7122.  
  7123.   See Appendix K of the MPW 3.0 Pascal Reference for details of PasMat
  7124.   directives and their functions. The first dialog box of the Pascal
  7125.   Commando dialog is reproduced here for your convenience.
  7126.  
  7127.  
  7128.                              Examples
  7129.  
  7130.   Pasmat -n -u -r -d -pattern "==formatted/=" Sample.p ∂
  7131.   "formatted/Sample.p"
  7132.  
  7133.   Formats the file Sample.p with the -n, -u, -r, and -d options and
  7134.   writes the output to the file "formatted/Sample.p". Include files
  7135.   are processed
  7136.  
  7137.   ( -pattern ), and each Pascal compiler $I include file causes additional
  7138.   output files to be generated. Each of these files is created with
  7139.   the name "formatted/ filename ", where filename is the filename specified
  7140.   in the corresponding include. (The -pattern parameter contains a
  7141.   null pattern (==) with "formatted/" as a replacement string—a null
  7142.   pattern always matches the start of a string.)
  7143.  
  7144.   Care must be taken when a command line contains quotes, slashes,
  7145.   or other special characters that are processed by the Shell itself.
  7146.   In this example, we used the slash character, so the strings containing
  7147.   it had to be quoted.
  7148.  
  7149.   Limitations PasMat has these limitations:
  7150.  
  7151.     • The maximum length of an input line is 255 characters.
  7152.  
  7153.     • The maximum output line length is 150 characters.
  7154.  
  7155.     • The input files and output files must be different.
  7156.  
  7157.     • Only syntactically correct programs, units, blocks, procedures,
  7158.     and statements are formatted. This limitation must be taken into
  7159.     consideration when separate MPW 3.0 include files and conditional
  7160.     compiler directives are to be formatted.
  7161.  
  7162.     • The Pascal include directive should be the last thing on the
  7163.     input line if include files are to be processed. Include files
  7164.     are processed to a maximum nesting depth of five. All include
  7165.     files not processed are summarized at the end of formatting.
  7166.     (This assumes, of course, that the in directive/option is in
  7167.     effect.)
  7168.  
  7169.     • The identifiers CYCLE and LEAVE are treated as reserved Pascal
  7170.     keywords by PasMat. They are treated as two loop control statements
  7171.     by Pascal unless explicitly declared.
  7172.  
  7173.     • While Pasmat supports Pascal’s $$Shell facility in include
  7174.     files, the processing of MPW’s {PInterfaces} files is not fully
  7175.     supported because these files conditionally include files (remember,
  7176.     conditionals are not processed). For this reason, do not use
  7177.     the -in or -e option to process files that include MPW {PInterfaces}
  7178.     files.
  7179.  
  7180.   Availability PasMat is available as part of a separate Apple product,
  7181.   MPW 3.0 Pascal .
  7182.  
  7183.  
  7184.                              See also 
  7185.  
  7186.   Pascal and PasRef commands.
  7187.  
  7188.   Appendix K of the MPW 3.0 Pascal Reference.
  7189.  
  7190. æKY PasRef
  7191. æC                  PasRef -- Pascal cross-referencer
  7192.  
  7193. PasRef [option…] [file…]  < file > crossReference ≥ progress
  7194.  -a                      # process includes and units each time encountered
  7195.  -c                      # process includes and units only once
  7196.  -cond                   # process $SETC and $IFC, $ELSEC, $ENDC conditionals
  7197.  -d                      # process each file separately
  7198.  -d name=TRUE|FALSE      # set $SETC variable name to TRUE or FALSE
  7199.  -i directory,…          # search for includes in directory,…
  7200.  -l                      # write identifiers in lower case
  7201.  -mc68020                # source contains {$IFC OPTION(MC68020)} directives
  7202.  -mc68881                # source contains {$IFC OPTION(MC68881)} directives
  7203.  -n                      # don't process USES or includes
  7204.  -ni | -noi[ncludes]     # don't process include files
  7205.  -nl | -nol[istings]     # don't list the input
  7206.  -nolex                  # don't write lexical information
  7207.  -nt | -not[otal]        # don't write total line count
  7208.  -nu | -nou[ses]         # don't process USES declarations   
  7209.  -o                      # source written using Object Pascal
  7210.  -p                      # write progress information to diagnostics
  7211.  -s                      # don't write include and USES filenames
  7212.  -t                      # cross reference by total line number
  7213.  -u                      # write identifiers in upper case
  7214.  -w width                # set output line width (default 110)
  7215.  -x width                # set maximum identifier width
  7216.  
  7217. Status codes returned:
  7218.   0    Normal termination.
  7219.   1    Parameter or option error.
  7220.  
  7221.                            Description
  7222.  
  7223.   Reads Pascal source files and writes a listing of the source followed
  7224.   by a cross-reference listing of all identifiers. Each identifier
  7225.   is listed in alphabetical order, followed by the number of the line
  7226.   on which it appears. Line numbers can refer to the entire source
  7227.   file, or can be relative to individual include files and units. Each
  7228.   reference indicates whether the identifier is defined, assigned,
  7229.   or simply named (for example, used in an expression).
  7230.  
  7231.   See the MPW 3.0 Pascal Reference for more information about the Pascal
  7232.   language. The first dialog box of PasRef’s Commando dialog is reproduced
  7233.   here for your convenience.
  7234.  
  7235.   Identifiers may be up to 63 characters long and are displayed in
  7236.   their entirety unless overridden with the -x directive. Identifiers
  7237.   can remain as they appear in the input, or they can be converted
  7238.   to all lowercase (-l ) or all uppercase (-u).
  7239.  
  7240.   For include files, line numbers are relative to the start of the
  7241.   include file; an additional key number indicates which include file
  7242.   is referred to. A list of each include file processed and its associated
  7243.   key number is displayed prior to the cross-reference listing.
  7244.  
  7245.   USES declarations can also be processed by PasRef (their associated
  7246.   $U filename compiler directives are processed as in the Pascal compiler).
  7247.   These declarations are treated exactly like includes, and, as with
  7248.   the compiler, only the outermost USES declaration is processed (that
  7249.   is, a used unit’s USES declaration is not processed).
  7250.  
  7251.   As an alternative to processing USES declarations, PasRef accepts
  7252.   multiple source files. Thus you cross-reference a set of main programs
  7253.   together with the units they use. All the sources are treated like
  7254.   include files for display purposes. In addition, PasRef checks to
  7255.   see whether it has already processed a file (for example, if it appeared
  7256.   twice on the input list, or if one of the files already used or included
  7257.   it). The file is skipped it has already been processed.
  7258.  
  7259.  
  7260.                              Examples
  7261.  
  7262.   PasRef -nu -w 80 Memory.p > Memory.p.Xref
  7263.  
  7264.   Cross-references the sample desk accessory Memory.p and writes the
  7265.   output to the file Memory.p.Xref. No USES declarations are processed
  7266.   (-nu). The following source and cross-reference listings are generated:
  7267.  
  7268.   1 1 1 -- {
  7269.   2 1 2 -- File Memory.p
  7270.   3 1 3 --
  7271.   4 1 4 -- Copyright Apple Computer, Inc. 1985-1987
  7272.   5 1 5 -- All rights reserved.
  7273.   6 1 6 -- }
  7274.   7 1 7 --
  7275.   8 1 8 -- {$D+} { MacsBug symbols on }
  7276.   9 1 9 -- {$R-} { No range checking }
  7277.   10 1 10 --
  7278.   11 1 11 -- UNIT Memory;
  7279.   12 1 12 --
  7280.   13 1 13 -- INTERFACE
  7281.   14 1 14 --
  7282.   15 1 15 -- USES
  7283.   16 1 16 -- MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf;
  7284.   17 1 17 --
  7285.   18 1 18 --
  7286.   19 1 19 -- FUNCTION DRVROpen (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7287.   20 1 20 -- FUNCTION DRVRControl (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7288.   21 1 21 -- FUNCTION DRVRStatus (ctlPB: ParmBlkPtr; dCtl:.DCtlPtr):OSErr;
  7289.   22 1 22 -- FUNCTION DRVRPrime (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7290.   23 1 23 -- FUNCTION DRVRClose (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7291.   24 1 24 --
  7292.   25 1 25 --
  7293.   26 1 26 -- IMPLEMENTATION
  7294.   etc.
  7295.  
  7296.   63 1 63 --A FUNCTION DRVRClose (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7297.   64 1 64 0-A BEGIN
  7298.   65 1 65 -- IF dCtl^.dCtlwindow <> NIL THEN
  7299.   66 1 66 1- BEGIN
  7300.   67 1 67 -- DisposeWindow (WindowPtr(dCtl^.dCtlWindow));
  7301.   68 1 68 -- dCtl^.dCtlWindow := NIL;
  7302.   69 1 69 -1 END;
  7303.   70 1 70 -- DRVRClose := NOErr;
  7304.   71 1 71 -0A END;
  7305.   etc.
  7306.  
  7307.   178 1 178 --
  7308.   179 1 179 -- END. {of memory UNIT}
  7309.   180 1 180 --
  7310.  
  7311.   Each line of the source listing is preceded by five columns of information:
  7312.  
  7313.   1. The total line count.
  7314.  
  7315.   2. The include key assigned by PasRef for an include or USES file.
  7316.   (See below.)
  7317.  
  7318.   3. The line number within the include or main file.
  7319.  
  7320.   4. Two indicators (left and right) that reflect the static block
  7321.   nesting level. The left indicator is incremented (mod 10) and displayed
  7322.   whenever a BEGIN, REPEAT, or CASE is encountered. On termination
  7323.   of these structures with an END or UNTIL, the right indicator is
  7324.   displayed, then decremented. It is thus easy to match BEGIN, REPEAT,
  7325.   and CASE statements with their matching terminations.
  7326.  
  7327.   5. A letter that reflects the static level of procedures. The character
  7328.   is updated for each procedure nest level ("A" for level 1, "B" for
  7329.   level 2, and so on), and displayed on the line containing the heading,
  7330.   and on the BEGIN and END associated with the procedure body. Using
  7331.   this column you can easily find the procedure body for a procedure
  7332.   heading when there are nested procedures declared between the heading
  7333.   and its body.
  7334.  
  7335.   The cross-reference listing follows:
  7336.  
  7337.   1. Memory.p
  7338.  
  7339.   -A-
  7340.  
  7341.   accEvent 144 ( 1)
  7342.   accRun 158 ( 1)
  7343.   ApplicZone 121 ( 1)
  7344.   Away 33* ( 1) 146 ( 1)
  7345.  
  7346.   -B-
  7347.  
  7348.   BeginUpdate 151 ( 1)
  7349.   BNOT 39 ( 1)
  7350.   Bold ( 1) 117 ( 1)
  7351.   Boolean 31* ( 1)
  7352.   BOR 39 ( 1)
  7353.   BSL 39 ( 1)
  7354.  
  7355.   -C-
  7356.  
  7357.   csCode 143 ( 1)
  7358.   CSParam 146 ( 1)
  7359.   ctlPB 19* ( 1) 20*( 1) 21*( 1) 22*( 1)..23*( 1) 43*( 1)
  7360.         63* ( 1) 74*( 1) 143 ( 1) 146 ( 1) 168*( 1) 173*( 1)
  7361.  
  7362.   -D-
  7363.  
  7364.   dCtl 19* ( 1) 20*( 1) 21*( 1) 22*( 1) 23*( 1) 37*( 1)
  7365.        39  ( 1) 43*( 1) 50 ( 1) 53 ( 1) 54 ( 1) 55 ( 1)
  7366.        63* ( 1) 65 ( 1) 67 ( 1) 68 ( 1) 74*( 1) 115 ( 1)
  7367.        142 ( 1) 168*( 1) 173*( 1)
  7368.   DCtlPtr 19 ( 1) 20 ( 1) 21 ( 1) 22 ( 1) 23 ( 1) 37 ( 1)
  7369.           43 ( 1) 63 ( 1) 74 ( 1) 168 ( 1) 173 ( 1)
  7370.   dCtlRefNum 39 ( 1) 54 ( 1)
  7371.   dCtlWindow 50 ( 1) 55=( 1) 67 ( 1) 68=( 1) 142 ( 1)
  7372.   etc.
  7373.  
  7374.   -V-
  7375.  
  7376.   VolName 79* ( 1) 100 ( 1) 135 ( 1)
  7377.  
  7378.   -W-
  7379.  
  7380.   what 149 ( 1)
  7381.   WindowKind 54= ( 1)
  7382.   windowpeek 54 ( 1)
  7383.   WindowPtr 48 ( 1) 67 ( 1) 151 ( 1) 153 ( 1)
  7384.   wRect 47* ( 1)
  7385.  
  7386.   *** End PasRef: 105 id's 249 references
  7387.  
  7388.   The numbers in parentheses following the line numbers are the include
  7389.   keys of the associated include files (shown in column 2 of the source
  7390.   listing). The include filenames are shown following the source listing.
  7391.   You can thus see what line number was in which include file. An asterisk
  7392.   (*) following a line number indicates a definition of the variable.
  7393.   An equal sign (=) indicates an assignment. A line number with nothing
  7394.   following it indicates a reference to the identifier.
  7395.  
  7396.   Limitations PasRef has these limitations:
  7397.  
  7398.     • PasRef does not process conditional compilation directives!
  7399.     Thus, given the "right" combination of $IFCs and $ELSECs, PasRef’s
  7400.     lexical (nesting) information can be thrown off. If this happens,
  7401.     or if you don’t want the lexical information, you can specify
  7402.     the -nolex option.
  7403.  
  7404.     • PasRef stores all its information on the Pascal heap. Up to
  7405.     5000 identifiers can be handled, but more identifiers will mean
  7406.     less cross-reference space. A message appears if PasRef runs
  7407.     out of heap space.
  7408.  
  7409.     • Note: Although PasRef never misses a reference, it can infrequently
  7410.     be fooled into thinking that a variable is defined when it actually
  7411.     isn’t. One case where this happens is in record structure variants.
  7412.     The record variant’s case tag is always flagged as a definition
  7413.     (even when there is no tag type) and the variant’s case label
  7414.     constants (if they are identifiers) are also sometimes incorrectly
  7415.     flagged, depending on the context. (This occurs only in the declaration
  7416.     parts of the program.)
  7417.  
  7418.     • While PasRef supports Pascal’s $$Shell facility in include
  7419.     files and USES declarations, the processing of MPW’s {PInterfaces}
  7420.     files is not fully supported because these files conditionally
  7421.     include files (remember, conditionals are not processed). For
  7422.     this reason, always use the -nu option to suppress processing
  7423.     of USES declarations.
  7424.  
  7425.     • The identifiers CYCLE and LEAVE are treated as reserved Pascal
  7426.     keywords by PasRef. These are treated as two loop control statements
  7427.     by Pascal unless explicitly declared.
  7428.  
  7429.   Availability PasRef is available as part of a separate Apple product,
  7430.   MPW 3.0 Pascal.
  7431.  
  7432.  
  7433.                              See also 
  7434.  
  7435.   Pascal command.
  7436.  
  7437.   MPW 3.0 Pascal Reference.
  7438.  
  7439. æKY Paste
  7440. æC          Paste -- replace selection with Clipboard contents
  7441.  
  7442. Paste [-c count] selection [window]
  7443.  -c count                # repeat the Paste count times
  7444.  
  7445. Status codes returned:
  7446.   0    At least one instance of the selection was found.
  7447.   1    Syntax error.
  7448.   2    Any other error.
  7449.  
  7450.                            Description
  7451.  
  7452.   Finds selection in the specified window and replaces its contents
  7453.   with the contents of the Clipboard. If no window is specified, the
  7454.   command operates on the target window (the second window from the
  7455.   front). It’s an error to specify a window that doesn’t exist.
  7456.  
  7457.   For a definition of selection, see "Selections" in Chapter 6 of the MPW 
  7458.   manual; a summary of the selection syntax is contained in Appendix B.
  7459.  
  7460.  
  7461.                              Examples
  7462.  
  7463.   Paste §
  7464.  
  7465.   Replaces the current selection with the contents of the Clipboard.
  7466.   This command is like the Paste item in the Edit menu, except that
  7467.   the action occurs in the target window.
  7468.  
  7469.   Paste /BEGIN/:/END/
  7470.  
  7471.   Selects everything from the next BEGIN to the following END and replaces
  7472.   the selection with the contents of the Clipboard.
  7473.  
  7474.  
  7475.                              See also 
  7476.  
  7477.   Copy, Cut, and Replace commands.
  7478.  
  7479.   "Edit Menu" in Chapter 3.
  7480.  
  7481.   "Selections" in Chapter 6.
  7482.  
  7483. æKY PerformReport
  7484. æC            PerformReport -- generate a performance report
  7485.  
  7486. PerformReport [option…]  > reportFile ≥ progress
  7487.  -a                      # list all procedures, in segment order
  7488.                          # (default: produce only partial list, sorted by %)
  7489.  -l linkDataFile         # read link map file (concatenated with ROM.list)
  7490.  -m measurementsFile     # read performance measurements file
  7491.                          # (default: "Perform.Out")
  7492.  -n NN                   # show the top NN procedures (default: 50)
  7493.  -p                      # write progress information to diagnostics
  7494.  
  7495. Status codes returned:
  7496.   0    No errors.
  7497.   1    Warning issued.
  7498.   2    Error encountered.
  7499.   3    Heap error;usually insufficient memory.
  7500.  
  7501.                            Description
  7502.  
  7503.   PerformReport reads a link map file and a performance data file and
  7504.   produces a report that relates the performance data to procedure
  7505.   names. The input files are both text files and are distinguished
  7506.   as separate options. For a full discussion of MPW’s performance measurement
  7507.   tools, see Chapter 14 of the MPW manual.
  7508.  
  7509.  
  7510.                              Examples
  7511.  
  7512.   Catenate "{MPW}"ROM.Maps:MacIIROM.map >> myMapFileName
  7513.  
  7514.   PerformReport -l myMapFileName > myReport
  7515.  
  7516.   Adds the ROM map file to the end of the link map file, myMapFileName.
  7517.   Reads the files myMapFileName and Perform.out and writes the output
  7518.   to myReport.
  7519.  
  7520.  
  7521.                              See also 
  7522.  
  7523.   Chapter 14, "Performance-Measurement Tools."
  7524.  
  7525.   MPW 3.0 Pascal Reference.
  7526.  
  7527.   MPW 3.0 C Reference .
  7528.  
  7529. æKY Position
  7530. æC              Position -- display current line position
  7531.  
  7532. Position [-l | -c] [window…]
  7533.  -l                      # only list the line number
  7534.  -c                      # only list the character offsets
  7535.  
  7536. Status codes returned:
  7537.   0    No errors.
  7538.   1    Syntax error.
  7539.   2    Any other error.
  7540.  
  7541.                            Description
  7542.  
  7543.   Position displays the position of the selection in each of the windows
  7544.   specified. If no window is specified, the position of the selection
  7545.   in the Target window is given. By default, the position is displayed
  7546.   as both the line number of the start of the selection and the character
  7547.   positions of the start and end of the selection. The -c option can
  7548.   be used to display only the character positions of the selection.
  7549.   Similarly, the -l option can be used to display only the line number.
  7550.  
  7551.  
  7552.                              Examples
  7553.  
  7554.   Position {Target} file2
  7555.  
  7556.   Displays the position of the selection in both the Target and file2
  7557.   in the following form:
  7558.  
  7559.   578 23129,23140
  7560.  
  7561.   211 8440,8440
  7562.  
  7563.  
  7564.                              See also 
  7565.  
  7566.   Find command.
  7567.  
  7568. æKY Print
  7569. æC                      Print -- print text files
  7570.  
  7571. Print [option…] file…  < file ≥ progress
  7572.  -b                   # print a border around the text
  7573.  -b2                  # alternate form of border
  7574.  -bm n[.n]            # bottom margin in inches (default 0)
  7575.  -c[opies] n          # print n copies
  7576.  -ff string           # treat "string" at beginning of line as a formfeed
  7577.  -f[ont] name         # print using specified font
  7578.  -from n              # begin printing with page n
  7579.  -h                   # print headers (time, file, page)
  7580.  -hf[ont] name        # print headers using specified font
  7581.  -hs[ize] n           # print headers using specified font size
  7582.  -l[ines] n           # print n lines per page
  7583.  -lm n[.n]            # left margin in inches (default .2778)
  7584.  -ls n[.n]            # line spacing (2 means double-space)
  7585.  -md                  # use modification date of file for time in header
  7586.  -n                   # print line numbers to left of text
  7587.  -nw [-]n             # width of line numbers, - indicates zero padding
  7588.  -p                   # write progress information to diagnostics
  7589.  -page n              # number pages beginning with n
  7590.  -ps filename         # include PostScript file as background for each page
  7591.  -q quality           # print quality (HIGH, STANDARD, DRAFT)
  7592.  -r                   # print pages in reverse order
  7593.  -rm n[.n]            # right margin in inches (default 0)
  7594.  -s[ize] n            # print using specified font size
  7595.  -t[abs] n            # consider tabs to be n spaces
  7596.  -title title         # include title in page headers
  7597.  -tm n[.n]            # top margin in inches (default 0)
  7598.  -to n                # stop printing after page n
  7599.  
  7600. Status codes returned:
  7601.   0    Successful completion.
  7602.   1    Parameter or option error.
  7603.   2    Execution error.
  7604.  
  7605.                            Description
  7606.  
  7607.   Prints text files on the currently selected printer. (Printers are
  7608.   selected with the Chooser desk accessory.) One or more files may
  7609.   be printed.
  7610.  
  7611.     • Note: Print does not substitute fonts unless the "Font Substitution"
  7612.     box is checked in the "LaserWriter Page Setup" dialog. To print
  7613.     in a font other than that indicated in the resource fork of the
  7614.     file where the MPW editor stores font information, use the -font
  7615.     option.
  7616.  
  7617.     • Important Print requires the printer drivers available on version
  7618.     1.0 (or later) of the Printer Installation disk.
  7619.  
  7620.  
  7621.                              Examples
  7622.  
  7623.   Print -h -size 8 -ls 0.85 Startup UserStartup
  7624.  
  7625.   Prints the files Startup and UserStartup with page headers, using
  7626.   Monaco 8 and compressing the line spacing.
  7627.  
  7628.   Print -b -hf helvetica -hs 12 -r print.p
  7629.  
  7630.   Prints the "print.p" source file with borders, with headers in Helvetica
  7631.   12, and with pages in reverse order.
  7632.  
  7633.  
  7634.                              See also 
  7635.  
  7636.   Print menu item in "File Menu," Chapter 3.
  7637.  
  7638. æKY PrintProff
  7639. æC   PrintProff -- analyze a .proff file and print the results
  7640.  
  7641. PrintProff TargetProgramName [-h | -f] [-c] [> outputFile]
  7642.     -h                      # hierarchical sort (default)
  7643.     -f                      # flat sort
  7644.     -c                      # for each procedure, list callees
  7645.  
  7646.  
  7647.                             Description
  7648.  
  7649. PrintProff is an MPW tool that analyzes the .proff data file created by running
  7650. a program built for profiling. PrintProff uses as input the target program’s 
  7651. .proff and .sym files.  By default, both of these files have the same name as the
  7652. target program with the appropriate extension added.  Also by default, PrintProff
  7653. looks for them in the Shell’s current directory.  Therefore, if the .proff and .sym
  7654. files are in the current directory, "TargetProgramName" is just the target's terminal
  7655. name.  Otherwise, it must be a full path name.  The .proff and .sym files in any case
  7656. must be in the same directory.  The output from PrintProff goes to standard output 
  7657. unless redirected to an output file.
  7658.  
  7659. The "-h" and "-f" options determine whether the information in the report is sorted
  7660. in the order, respectively, of descending "hierarchical" times or descending 
  7661. "flat" times (see below).
  7662.  
  7663. The "-c" option causes the redundant printing, for each procedure, of the profiling
  7664. data for each of its callees.
  7665.  
  7666. The report produced by PrintProff shows, for every monitored procedure (or 
  7667. function),the name of its caller and the statement number of the point of call, 
  7668. and, if the -c option is used, the names of its (monitored) callees.  Defining 
  7669. an "arc" to be an execution of a procedure from a specific call site, 
  7670. PrintProff reports:
  7671.  
  7672. 1.The number of times each arc was executed.
  7673.  
  7674. 2.The cumulative flat time for the arc.  The flat time is the amount of time spent
  7675. executing the procedure. It does not include time spent in callee procedures, 
  7676. provided these procedures were also monitored.  Nor does it include segment
  7677. loading or profiling overhead for the current procedure but it does include some
  7678. performance monitoring and procedure call overhead for the procedure (if any) 
  7679. called directly by the current one.  Note: If a callee was not built with the 
  7680. profiling options or directives, the profiling code will think that the callee 
  7681. was merely part of its caller.
  7682.  
  7683. 3. The cumulative hierarchical time for the arc. The hierarchical time is the
  7684. amount of time spent in this procedure, plus the time spent in any procedures 
  7685. called by this one (directly or indirectly) before it returns to its caller. 
  7686. It does not include segment loading or profiling overhead for the current 
  7687. procedure.  However, the hierarchical time does include this overhead for 
  7688. called procedures.
  7689.  
  7690. 4. For calls across segments, the caller and the callee segment name and number.
  7691.  
  7692.  
  7693.  
  7694.                                 Examples
  7695.  
  7696. 2____________________________________________________________________________________
  7697. SkelMain
  7698.     Total Time:              9,768,889 H       2,135,743 F/1   (95.236%H/20.821%F)
  7699.  
  7700.     Called by Procs:
  7701.        1  main.(51)
  7702.                            9,768,889 H      2,135,743 F/1   1/Main -> 3/TransSkel
  7703.     Calls Procs:
  7704.           3  Background
  7705.                            3,614,659 H      1,786,999 F/233 3/TransSkel -> 1/Main
  7706.           4  DoEvent
  7707.                            3,531,485 H      2,381,569 F/39 
  7708.           9  LogEvent
  7709.                              448,654 H          2,432 F/39     3/TransSkel -> 1/Main
  7710.          32  DoIdle
  7711.                               38,347 H         20,059 F/806
  7712.  
  7713.   3____________________________________________________________________________________
  7714. Background
  7715.     Total Time:              3,614,659 H          1,786,999 F/233 (35.239%H/17.421%F)
  7716.  
  7717.     Called by Procs:
  7718.            2  SkelMain.(7)
  7719.                             3,614,659 H     1,786,999 F/233 3/TransSkel -> 1/Main
  7720.     Calls Procs:
  7721.            5  fugitIdle
  7722.                             1,757,392 H     1,757,392 F/233
  7723.           26  CheckFront
  7724.                                70,267 H        43,840 F/233
  7725.  
  7726.  
  7727.  
  7728.  4____________________________________________________________________________________
  7729. DoEvent
  7730.     Total Time:            3,531,485 H       2,381,569 F/39   (34.428%H/23.218%F)
  7731.  
  7732.      Called by Procs:
  7733.           2  SkelMain.(15)
  7734.                            3,531,485 H     2,381,569 F/39 
  7735.      Calls Procs:
  7736.           6  DoMenuCommand
  7737.                              812,762 H        11,903 F/3  
  7738.          14  DoUpdate
  7739.                              183,092 H         3,511 F/11 
  7740.          21  DoMouse
  7741.                              125,578 H           292 F/5  
  7742.          38  DoActivate
  7743.                               25,193 H           547 F/11 
  7744.          55  DoDialog
  7745.                                1,211 H         1,211 F/39 
  7746.          54  GetWHandler
  7747.                                  840 H           639 F/13 
  7748.          54  GetWHandler
  7749.                                  621 H           465 F/11 
  7750.          54  GetWHandler
  7751.                                  616 H           464 F/11 
  7752. Notes on the example:
  7753. •   Entries like 3/TransSkel -> 1/Main indicate inter-segment calls and show segment 
  7754.     number and segment name for caller and callee.
  7755.  
  7756. •   In the entry "3,614,659 H       1,786,999 F/233", the integer following the "/" 
  7757.     is the number of executions of the arc.  H indicates hierarchical time and F 
  7758.     indicates flat time.  These times are the sum of the times for all executions of 
  7759.     the arc--in this case 233 executions.  Units are microseconds and represent real 
  7760.     time.
  7761.  
  7762. •   In the entry "2  SkelMain.(7)", the integer in parenthesis is the statement number
  7763.     at which the call occurs.
  7764.  
  7765. •    The information provided about each monitored procedure contains a "Called by 
  7766.      procs:" and an optional "Calls procs:" section.  In these sections, the integer
  7767.      preceding each procedure name listed is an index back to that procedure’s ranking
  7768.      in the major sort of monitored procedures.
  7769.  
  7770. •    The information provided about each monitored procedure contains an optional
  7771.     "Calls procs:" section.  The time given for a procedure listed in this section is 
  7772.      the total time for the arc originating in the monitored procedure and ending in 
  7773.      the called procedure.  This value is not the total time for the called procedure 
  7774.      unless the monitored procedure is its only caller.   If the same procedure is
  7775.      listed multiple times in the "Calls procs:" section, this shows that it was 
  7776.      called from that number of different locations in the monitored procedure.
  7777.  
  7778.                             See also
  7779.  
  7780. Profiling
  7781.  
  7782. æKY ProcNames
  7783. æC        ProcNames -- display Pascal procedure and function names
  7784.  
  7785. ProcNames [option…] [file…]  < file ≥ progress
  7786.     -b                      # display line info for procedure body
  7787.     -c                      # process includes and units only once
  7788.     -cond                   # process $SETC and $IFC, $ELSEC, $ENDC conditionals
  7789.     -d                      # reset total line count to 1 on each new file
  7790.     -d name=TRUE|FALSE      # set $SETC variable name to TRUE or FALSE
  7791.     -e                      # suppress page eject between each procedure listing
  7792.     -f                      # PasMat format compatibility mode
  7793.     -i pathname,…           # search for includes or USES in directory,…
  7794.     -l n                    # process only to max nesting level n
  7795.     -m                      # generate MPW Mark commands for procedure and function declarations
  7796.     -mc68020                # source contains {$IFC OPTION(MC68020)} directives
  7797.     -mc68881                # source contains {$IFC OPTION(MC68881)} directives
  7798.     -n                      # suppress line number and level information
  7799.     -o                      # source file is an Object Pascal program
  7800.     -p                      # write progress information to diagnostics
  7801.     -u                      # process USES declarations
  7802.  
  7803.   Status codes returned:
  7804.      0    Normal termination.
  7805.      1    Parameter or option error.
  7806.  
  7807.                            Description
  7808.  
  7809.   ProcNames is a Pascal utility that accepts a Pascal program or unit
  7810.   as input and produces a listing of all its procedure and function
  7811.   names. The names are shown indented as a function of their nesting
  7812.   level. The nesting level and line-number information is also displayed.
  7813.  
  7814.   ProcNames can be used in conjunction with the Pascal "pretty-printer"
  7815.   PasMat when that utility is used to format separate include files.
  7816.   For that case, PasMat requires that the initial indenting level be
  7817.   specified. This level is exactly the information provided by ProcNames.
  7818.  
  7819.   The line-number information displayed by ProcNames exactly matches
  7820.   that produced by the Pascal cross-reference utility PasRef (with
  7821.   or without USES declarations being processed), so ProcNames can be
  7822.   used in conjunction with the listing produced by PasRef to show just
  7823.   the line numbers of every procedure or function header.
  7824.  
  7825.   Another possible use for the ProcNames output is to use the line-number
  7826.   and file information to find procedures and functions quickly with
  7827.   Shell editing commands.
  7828.  
  7829.  
  7830.                              Examples
  7831.  
  7832.   procnames Memory.p >names
  7833.  
  7834.   Lists all the procedures and functions for the Pascal program Memory.p
  7835.   and writes the output to the file "names". The listing below is the
  7836.   output generated in the "names" file.
  7837.  
  7838.   Procedure/Function names for Memory.p
  7839.  
  7840.    11  11 0 Memory[Main] Memory.p
  7841.    37  37 1 RsrcID
  7842.    43  43 1 DRVROpen
  7843.    63  63 1 DRVRCloseaa
  7844.    74  74 1 DRVRControla
  7845.    76  76 2   DrawWindow
  7846.    83  83 3     PrintNum
  7847.    93  93 3     GetVolStuff
  7848.   108 108 3     PrtRsrcStr
  7849.   168 168 1 DRVRPrime
  7850.   173 173 1 DRVRStatus
  7851.  
  7852.   *** End ProcNames: 11 Procedures and Functions
  7853.  
  7854.   The first two columns on each line are line-number information. The
  7855.   third column is the level number. The first column shows the line
  7856.   number of a routine within the total source. The second column shows
  7857.   the line number within an include file (include files are always
  7858.   processed). As each include file changes, the name of the file from
  7859.   which input is being processed is shown along with the routine name
  7860.   on the first line after the change in source. Segment names (from
  7861.   Pascal compiler $S directives) are similarly processed. These are
  7862.   shown enclosed in square brackets (the blank segment name is shown
  7863.   as "[Main]").
  7864.  
  7865.   Limitations Only syntactically correct programs are accepted by ProcNames.
  7866.   Conditional compilation compiler directives are not processed.
  7867.  
  7868.   Although ProcNames supports $$Shell facility in includes and USES,
  7869.   the processing of MPW’s {PInterfaces} files is not fully supported
  7870.   because these files conditionally include files. Therefore, do not
  7871.   use the -u option.
  7872.  
  7873. æKY Project
  7874. æC             Project -- set or write the current project
  7875.  
  7876. Project [-q | projectName]   > project
  7877.  -q                      # don't quote projects with special characters
  7878.  
  7879. Status codes returned:
  7880.   0    No errors.
  7881.   1    Syntax error.
  7882.   2    Error in processing.
  7883.  
  7884.                            Description
  7885.  
  7886.   Set the current project to projectname or list the current project
  7887.   if projectname is omitted. Projectname must be a mounted project.
  7888.   Refer to the MountProject command for information on how to mount
  7889.   projects.
  7890.  
  7891.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7892.   symbols used in Projector commands.
  7893.  
  7894. æKY ProjectInfo
  7895. æC          ProjectInfo -- display information about a Project
  7896.  
  7897. ProjectInfo [-project project] [-comments] [-latest] [-f] [-r] [-s] [-only 
  7898.             | -m] [-af author | -a author] [-df dates | -d dates] 
  7899.             [-cf pattern | -c pattern] [-t pattern] [-n name] 
  7900.             [-newer | -update] [file…]
  7901.  -a author         # only list revisions created by author
  7902.  -af author        # only list files created by author
  7903.  -c pattern        # only list revisions whose comment contains pattern
  7904.  -cf pattern       # only list files whose comment contains pattern
  7905.  -comments         # list comments along with the rest of the information
  7906.  -d dates          # only list revisions whose create date is within dates
  7907.  -df dates         # only list files whose mod date is within dates
  7908.  -f                # list file information
  7909.  -log              # print project log
  7910.  -m                # only list files/revisions that are checked out
  7911.  -newer            # info on files that would be checked out using this option
  7912.  -only             # only list project information
  7913.  -project project  # name of project to get information on
  7914.  -r                # recursively list subprojects
  7915.  -latest           # only list info on the latest revision on the main trunk
  7916.  -s                # short listing, names and revision names only
  7917.  -t pattern        # only list revisions whose task contains pattern
  7918.  -n name           # only list revisions that have name
  7919.  -update           # info on files that would be checked out using this option
  7920.  
  7921.  Note: pattern is either a literal string or /regular expression/.
  7922.  
  7923.  Note: "dates" may take the following forms:
  7924.      date                # on date
  7925.      <date               # before but not including date
  7926.      ≤date               # before and including date
  7927.      >date               # after and not including date
  7928.      ≥date               # after and including date
  7929.      date-date           # between and including dates
  7930.      
  7931.  Note:  A date is mm/dd/yy [[hh:mm[:ss]] [AM|PM]]
  7932.  
  7933.  Note: "name" may take the following forms:
  7934.      name                # in name
  7935.      <name               # before name
  7936.      ≤name               # before and including name
  7937.      >name               # after name
  7938.      ≥name               # after and including name
  7939.  
  7940. Status codes returned:
  7941.   0    No errors.
  7942.   1    Syntax error.
  7943.   2    Error in processing.
  7944.   3    System error.
  7945.  
  7946.                            Description
  7947.  
  7948.   By default (with no options specified), ProjectInfo lists information
  7949.   about each revision in every revision tree (file) in the current
  7950.   project. This behavior can be changed using the various options.
  7951.   For example, using the -latest option will display only information
  7952.   about the latest revision on the main trunk of each revision tree.
  7953.   Using the -f option will display information about the revision tree,
  7954.   rather than the particular revisions within that tree. Various other
  7955.   options exist that filter the output such that only the information
  7956.   (typically revisions) that passes through the filter is listed.
  7957.  
  7958.   If object is a project pathname such as Enterprise∫Phaser∫file.c
  7959.   or Enterprise∫Phaser, Projector lists information about every revision
  7960.   of file.c in the Phaser project, or information about every revision
  7961.   tree in the project Enterprise∫Phaser, respectively.
  7962.  
  7963.   If object is a leafname such as file.c, Projector looks in the current
  7964.   project for a revision tree with that name. If found, information
  7965.   about every revision in that revision tree (file.c) is listed. If
  7966.   the file is not a member of the current project, Projector looks
  7967.   for the file in the current directory. If the file exists and is
  7968.   part of a project, then the current state of that file is listed.
  7969.   Projector can determine whether a file belongs to a project because
  7970.   that information is maintained in the resource fork of all checked-out
  7971.   files.
  7972.  
  7973.   Finally, if object is a valid partial or full HFS pathname of a file,
  7974.   and the file is part of a project, then the current state of that
  7975.   file is listed.
  7976.  
  7977.   To list the contents of a specific revision of a file, append a comma
  7978.   followed by the revision number to the filename specified. For example,
  7979.   revision 22 of file.c is specified as file.c,22.
  7980.  
  7981.   You can use the -af, -a, -df, -d, -n, -cf, -c, and -t options to
  7982.   filter (constrain) the information listed to specific authors, dates,
  7983.   names, specific comments, or tasks.
  7984.  
  7985.   Use the -log option to display a log of all changes to the project.
  7986.   These commands are logged: NameRevisions, DeleteRevisions, and DeleteNames.
  7987.  
  7988.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7989.   symbols used in Projector commands.
  7990.  
  7991.  
  7992.                              Examples
  7993.  
  7994.   In the example below, the current project has three files. The -latest
  7995.   option is used so that only information about the latest revision
  7996.   on the main trunk is listed. The presence of the plus sign (+) indicates
  7997.   that Bob currently has revision 22 of file.c checked out for modification,
  7998.   and that Peter has revision 33 of hdr.c checked out for modification.
  7999.   The date field of these two files reflects the date and time they
  8000.   were checked out. Because no plus sign appears on the line for file.h,
  8001.   it can be checked out for modification. The latest revision of file.h
  8002.   is 17, and the author of the revision is Bob.
  8003.  
  8004.   ProjectInfo -latest
  8005.  
  8006.   Sample∫
  8007.   file.c,22+
  8008.     Owner: Bob
  8009.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8010.     Task: Fixing bug #223
  8011.  
  8012.   file.h,17
  8013.     Author: Bob
  8014.     Checked in: Mon, Apr 4, 1988, 10:10 AM
  8015.     Task:
  8016.  
  8017.   hdr.c,33+
  8018.     Owner: Peter
  8019.     Checked out: Tue, Apr 12, 1988, 5:58 PM
  8020.     Task: Fixing bug #333
  8021.  
  8022.   Using the -only option causes ProjectInfo to list only information
  8023.   about the project itself.
  8024.  
  8025.   ProjectInfo -only
  8026.  
  8027.   Sample∫
  8028.     Author: Bob
  8029.     Create date: Mon, Apr 4, 1988 8:20 AM
  8030.     Mod date: Thu, Apr 14, 1988, 6:00 PM
  8031.  
  8032.   Use the -f option to list filenames. Note that revision numbers are
  8033.   absent and that the file’s author and last-mod-date are listed. In
  8034.   the example below, file.c and hdr.c are currently checked out.
  8035.  
  8036.   ProjectInfo -f
  8037.  
  8038.   Sample∫
  8039.   file.c
  8040.     Author: Bob
  8041.     Create date: Mon, Apr 4, 1988, 10:00 AM
  8042.     Mod date: Tue, Apr 5, 1988, 2:15 PM
  8043.     Free: No
  8044.  
  8045.   file.h
  8046.     Author: Bob
  8047.     Create date: Mon, Apr 4, 1988, 10:00 AM
  8048.     Mod date: Mon, Apr 4, 1988, 10:00 AM
  8049.     Free: Yes
  8050.  
  8051.   hdr.c
  8052.     Author: Peter
  8053.     Create date: Mon, Apr 4, 1988, 3:30 PM
  8054.     Mod date: Mon, Apr 4, 1988, 6:00 PM
  8055.     Free: No
  8056.  
  8057.   Use the -f and -s options together to output the list of files in
  8058.   the project:
  8059.  
  8060.   ProjectInfo -f -s
  8061.  
  8062.   Sample∫
  8063.   file.c
  8064.   file.h
  8065.   hdr.c
  8066.  
  8067.   The following command will display the entire revision history of
  8068.   file.c. Note that the comment option has been included here as well.
  8069.  
  8070.   ProjectInfo -comments file.c
  8071.  
  8072.   file.c,2+
  8073.     Owner: Bob
  8074.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8075.     Task: Fixing bug #223
  8076.     Comment: COMMENT…
  8077.  
  8078.   file.c,2
  8079.     Author: Bob
  8080.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8081.     Task: Fixing bug #222
  8082.     Comment: COMMENT…
  8083.  
  8084.   file.c,1
  8085.     Author: Bob
  8086.     Checked in: Mon, Apr 4, 1988, 9:25 PM
  8087.     Task: Updating procedure comments
  8088.     Comment: COMMENT…
  8089.  
  8090.   Information about HFS files may be displayed by specifying a partial
  8091.   or full HFS pathname. This displays the information in the 'ckid'
  8092.   resource of the file.
  8093.  
  8094.   ProjectInfo :file.c
  8095.  
  8096.   :file.c,22*
  8097.     Owner: Bob
  8098.     Project: Sample∫
  8099.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8100.     Task: Fixing bug #223
  8101.  
  8102.   The asterisk (*) following the name indicates that the file is a
  8103.   modified read-only file.
  8104.  
  8105.   In the example below, only revisions created by Bob and created on
  8106.   or after April 4, 1988, are displayed.
  8107.  
  8108.   ProjectInfo -a Bob -d
  8109.  
  8110.   Sample∫
  8111.   file.c,22+
  8112.     Owner: Bob
  8113.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8114.     Task: Fixing bug #223
  8115.  
  8116.   file.c,22
  8117.     Author: Bob
  8118.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8119.     Task: Fixing bug #222
  8120.  
  8121.   file.c,21
  8122.     Author: Bob
  8123.     Checked in: Mon, Apr 4, 1988, 9:25 PM
  8124.     Task: Updating procedure comments
  8125.  
  8126.   file.h,17
  8127.     Author: Bob
  8128.     Checked in: Mon, Apr 4, 1988, 10:10 AM
  8129.     Task:
  8130.  
  8131.   In the example below, only revisions that have a task dealing with
  8132.   Bug #222 are listed.
  8133.  
  8134.   ProjectInfo -t /bug≈222/
  8135.  
  8136.   Sample∫
  8137.   file.c,22
  8138.     Author: Bob
  8139.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8140.     Task: Fixing bug #222
  8141.  
  8142.   hdr.c,31
  8143.     Author: Peter
  8144.     Checked in: Fri, Apr 1, 1988, 3:50 PM
  8145.     Task: Bug222 - Adding check procedure
  8146.  
  8147.   The final example demonstrates the -log option.
  8148.  
  8149.   ProjectInfo -log
  8150.  
  8151.   TheShell∫Projector
  8152.     7/5/88 4:07 PM
  8153.       Peter J. Potrebic
  8154.       DeleteNames Work
  8155.     7/2/88 1:37 PM
  8156.       Peter J. Potrebic
  8157.       NameRevisions Work bitmaps.a,2 ckid.c,3a2
  8158.  
  8159.   The log shows that Peter created a public name on July 2 and then
  8160.   deleted it on July 5.
  8161.  
  8162.  
  8163.                              See also 
  8164.  
  8165.   MountProject and UnmountProject.
  8166.  
  8167. æKY Quit
  8168. æC                          Quit -- quit MPW
  8169.  
  8170. Quit [-y | -n | -c]
  8171.  -y                  # save all modified windows (avoids dialog)
  8172.  -n                  # do not save any modified windows (avoids dialog)
  8173.  -c                  # cancel if a window needs to be saved (avoids dialog)
  8174.  
  8175. Status codes returned:
  8176.   1    Syntax error.
  8177.   2    Command aborted.
  8178.        Note: Quit cannot return a status of 0, because if there are no errors 
  8179.        the command never returns.
  8180.  
  8181.                            Description
  8182.  
  8183.   This command is equivalent to the menu command Quit. Quit executes
  8184.   the standard quit procedures, asking confirmation to save modified
  8185.   files, close all windows, and so on.
  8186.  
  8187.  
  8188.                              Examples
  8189.  
  8190.   Quit -y
  8191.  
  8192.   Quits MPW answering "Yes" to any dialogs such as those prompting
  8193.   to save files.
  8194.  
  8195.   Quit -c
  8196.  
  8197.   Quits MPW, unless any confirmation dialogs occur and dialog boxes
  8198.   are displayed.
  8199.  
  8200.  
  8201.                              See also 
  8202.  
  8203.   Shutdown command.
  8204.  
  8205. æKY Quote
  8206. æC             Quote -- echo parameters, quoting if needed
  8207.  
  8208. Quote [-n] [parameter…]   > parameters
  8209.  -n                      # don't write return following the parameters
  8210.  
  8211. Status codes returned:  
  8212.  0  no errors always returned.
  8213.  
  8214.                            Description
  8215.  
  8216.   Quote writes its parameters, separated by spaces and terminated by
  8217.   a return, to standard output. Parameters containing characters that
  8218.   have special meaning to the Shell’s command interpreter are quoted
  8219.   with single quotation marks. If no parameters are specified, only
  8220.   a return is written.
  8221.  
  8222.   Quote is identical to Echo except that Quote quotes parameters that
  8223.   contain special characters. Quote is especially useful when using
  8224.   Shell commands to write a script.
  8225.  
  8226.   The following special characters are quoted:
  8227.  
  8228.   Space Tab Return Null
  8229.  
  8230.   # ; & | ( ) ∂ ' " / \ { } ` ? ≈ [ ] + * « » ® < > ≥ …
  8231.  
  8232.  
  8233.                              Examples
  8234.  
  8235.   Echo ≈.a
  8236.  
  8237.   Quote ≈.a
  8238.  
  8239.   Sample.a Count.a My Program.a
  8240.  
  8241.   Sample.a Count.a 'My Program.a'
  8242.  
  8243.   Echo and Quote behave slightly differently for parameters that contain
  8244.   special characters. The first line above was produced by Echo; the
  8245.   second by Quote.
  8246.  
  8247.   Quote Notice what happens to single quotes: "--'--"
  8248.  
  8249.   Notice what happens to single quotes: '--'''--'
  8250.  
  8251.   Because single quotes can’t appear within single quotes, they are
  8252.   replaced with
  8253.  
  8254.   '' ' which closes the original single quote, adds a literal quote,
  8255.   and reopens the single quotes.
  8256.  
  8257.   For file In ≈.a
  8258.     Quote Print "{file}"
  8259.   End
  8260.   Print Sample.a
  8261.   Print Count.a
  8262.   Print 'My Program.a'
  8263.  
  8264.   The For loop shown above writes a Print command for each file that
  8265.   matches the pattern ≈.a. These commands can then be selected and
  8266.   executed. Notice the quotation marks in the last Print command.
  8267.  
  8268.  
  8269.                              See also 
  8270.  
  8271.   Echo and Parameters commands.
  8272.  
  8273. æKY Rename
  8274. æC               Rename -- rename files and directories
  8275.  
  8276. Rename [-y | -n | -c] oldName newName
  8277.  -y                      # overwrite existing file (avoids dialog)
  8278.  -n                      # don't overwrite existing file (avoids dialog)
  8279.  -c                      # cancel if conflict occurs (avoids dialog)
  8280.  
  8281. Status codes returned:
  8282.   0    Successful rename.
  8283.   1    Syntax error.
  8284.   2    Name does not exist.
  8285.   3    An error occurred.
  8286.   4    Cancel was selected or implied by the -c option.
  8287.  
  8288.                            Description
  8289.  
  8290.   The file, folder or disk specified by name is renamed newName. A
  8291.   dialog box requests a confirmation if the rename would overwrite
  8292.   an existing file or folder. The -y, -n, or -c options can be used
  8293.   to avoid this interaction.
  8294.  
  8295.     • Note: You can’t use the Rename command to change the directory
  8296.     a file is in. To do this, use the Move command.
  8297.  
  8298.     • Note also: Wildcard renames in the following form will not
  8299.     work:
  8300.  
  8301.   Rename ≈.text ≈.p
  8302.  
  8303.   This is because the Shell expands the filename patterns "≈.text"
  8304.   and "≈.p" before invoking the Rename command. In order to gain the
  8305.   desired effect, you would need to execute a command such as the one
  8306.   shown in the fifth example below.
  8307.  
  8308.  
  8309.                              Examples
  8310.  
  8311.   Rename File1 File2
  8312.  
  8313.   Changes the name of File1 to File2.
  8314.  
  8315.   Rename HD:Programs:Prog.c Prog.Backup.c
  8316.  
  8317.   Changes the name of Prog.c in the directory HD:Programs to Prog.Backup.c
  8318.   in the same directory.
  8319.  
  8320.   Rename Untitled: Backup:
  8321.  
  8322.   Changes the name of the disk Untitled to Backup.
  8323.  
  8324.   Rename -c File1 File2
  8325.  
  8326.   Changes the name of File1 to that of File2; if a conflict occurs,
  8327.   it cancels the operation and returns a status of 4.
  8328.  
  8329.   To perform a wildcard rename, you could execute the following set
  8330.   of commands:
  8331.  
  8332.   For Name In ≈.text
  8333.     ( Evaluate {Name} =~ /(≈)®1.text/ ) > Dev:Null
  8334.     Rename {Name} {®1}.p
  8335.   End
  8336.  
  8337.   The Evaluate command is executed only for its side effect of permitting
  8338.   regular expression processing. (The expression operator =~ indicates
  8339.   that the right side of the expression is a regular expression.) Thus,
  8340.   you can use the regular expression capture mechanism, (regularExpr)®n.
  8341.   Evaluate’s output is tossed in the bit bucket (Dev:Null).
  8342.  
  8343.  
  8344.                              See also 
  8345.  
  8346.   Move command.
  8347.  
  8348. æKY Replace
  8349. æC                   Replace -- replace the selection
  8350.  
  8351. Replace [-c count] selection replacement [window]
  8352.  -c count                # repeat the replace count times
  8353.  
  8354. Status codes returned:
  8355.   0    At least one instance of the selection was found.
  8356.   1    Syntax error.
  8357.   2    Any other error.
  8358.  
  8359.                            Description
  8360.  
  8361.   Replace finds selection in the specified window and replaces it with
  8362.   replacement. If no window is specified, the command operates on the
  8363.   target window (the second window from the front). It’s an error to
  8364.   specify a window that doesn’t exist. If a count is specified, the
  8365.   Replace command is repeated count times.
  8366.  
  8367.   For a definition of selection, see "Selections" in Chapter 6 of the MPW
  8368.   manual. A summary of the selection syntax is contained in Appendix B.
  8369.  
  8370.   You can include references to parts of the selection in the replacement
  8371.   by using the ® operator. The expression ®n, where n is a digit, is
  8372.   replaced with the string of characters that matches the regular expression
  8373.   tagged by ®n in the selection. (See "Tagging Regular Expressions
  8374.   With the ® Operator" in Chapter 6.)
  8375.  
  8376.   The selection is a selection expression while replacement is a string
  8377.   (that could contain the ® operator). If replacement contains spaces
  8378.   or special characters, enclose it in quotation marks.
  8379.  
  8380.   All searches are by default not case sensitive. To specify case-sensitive
  8381.   matching, set the {CaseSensitive} variable before executing the command.
  8382.  
  8383.  
  8384.                              Examples
  8385.  
  8386.   Replace -c ∞ /myVar/ 'myVariable' Prog.p
  8387.  
  8388.   Replaces every subsequent instance of the selection with the string
  8389.   in single quotation marks.
  8390.  
  8391.   Replace -c 5 /•[ ]+/ ''
  8392.  
  8393.   Strips off all the spaces and tabs at the front of the next five
  8394.   lines in the file (and replaces them with the null string). This
  8395.   action takes place in the target window.
  8396.  
  8397.   Set HexNum "[0-9A-F]+"
  8398.   Set Spaces "[ ]+"
  8399.   Replace -c ∞ /({HexNum})®1{Spaces}({HexNum})®2/ ®1 ®2
  8400.  
  8401.   Defines two variables for use in the subsequent Replace command,
  8402.   and converts a file that contains two columns of hex digits (such
  8403.   as the icon list from ResEdit) into a single column of hex digits.
  8404.  
  8405.  
  8406.                              See also 
  8407.  
  8408.   Find and Clear commands.
  8409.  
  8410.   Chapter 6.
  8411.  
  8412.   Appendix B.
  8413.  
  8414. æKY Request
  8415. æC              Request -- request text from a dialog box
  8416.  
  8417. Request [-q] [-d default] [message…] < file 
  8418.  -q                      # don't set status if user selects cancel
  8419.  -d default              # set default response
  8420.  
  8421. Status codes returned:
  8422.   0    The OK button was selected.
  8423.   1    Syntax errors.
  8424.   4    The Cancel button was selected.
  8425.  
  8426.                            Description
  8427.  
  8428.   Request displays an editable text dialog box with OK and Cancel buttons
  8429.   and the prompt message. If you select the OK button, any text you
  8430.   type into the dialog box is written to standard output. The -d option
  8431.   lets you set a default response to the request.
  8432.  
  8433.  
  8434.                              Examples
  8435.  
  8436.   Set Exit 0
  8437.   Set FileName "`Request 'File to compile' -d "{Active}"`"
  8438.   If {FileName} ≠ ""
  8439.     Pascal "{FileName}" ≥≥ "{WorkSheet}"
  8440.   End
  8441.   Set Exit 1
  8442.  
  8443.   Displays a dialog box that lets the user enter the name of a file
  8444.   to be compiled. Sets the default to be the name of the active window,
  8445.   as follows:
  8446.  
  8447. æKY ResEqual
  8448. æC           ResEqual -- compares the resources in two files
  8449.  
  8450. ResEqual [-p] File1 File2
  8451.  -p                      # write progress information to diagnostics
  8452.  
  8453. Status codes returned:
  8454.   0    Resources match.
  8455.   1    Parameter or option error.
  8456.   2    Files don’t match.
  8457.  
  8458.                            Description
  8459.  
  8460.   ResEqual compares the resources in two files and writes their differences
  8461.   to standard output.
  8462.  
  8463.   ResEqual checks that each file contains resources of the same type
  8464.   and identifier as the other file; that the size of the resources
  8465.   with the same type and identifier are the same; and that their contents
  8466.   are the same.
  8467.  
  8468.  
  8469.                              Examples
  8470.  
  8471.   Resequal Sample Sample.rsrc
  8472.  
  8473.   Compares the resources in Sample and Sample.rsrc, writing the results
  8474.   to standard output.
  8475.  
  8476.   Limitations When the contents of resources are compared and a mismatch
  8477.   is found, the mismatch and the subsequent 15 bytes are written. ResEqual
  8478.   then continues the comparison, starting with the byte following the
  8479.   last displayed.
  8480.  
  8481.   If more than ten differences are detected in the same resource, the
  8482.   rest of the resource is skipped and processing continues with the
  8483.   next resource.
  8484.  
  8485.  
  8486.                              See also 
  8487.  
  8488.   Equal command. (The -r option of Equal compares the resource forks
  8489.   of files on a byte-by-byte basis, including the resource map.)
  8490.  
  8491.  
  8492. æKY Revert
  8493. æC           Revert -- revert window to previous saved state
  8494.  
  8495. Revert [-y] [window…]
  8496.  -y                      # revert to old version (without dialog)
  8497.  
  8498. Status codes returned:
  8499.   0    No errors.
  8500.   1    Parameter or option error.
  8501.   2    The specified window does not exist.
  8502.   3    A system error occurred.
  8503.   4    The Cancel button was selected.
  8504.  
  8505.                            Description
  8506.  
  8507.   Reverts the specified windows to their previously saved states. If
  8508.   no window is specified, Revert works on the target window. Revert
  8509.   displays a confirmation dialog box, but you can avoid this dialog
  8510.   box by using the -y option to revert unconditionally to the last
  8511.   saved version of the document.
  8512.  
  8513.  
  8514.                              Examples
  8515.  
  8516.   Revert
  8517.  
  8518.   Displays a confirmation dialog box for reverting the target window
  8519.   to its last saved state.
  8520.  
  8521.   Revert -y {Worksheet}
  8522.  
  8523.   Reverts unconditionally to last saved worksheet.
  8524.  
  8525.  
  8526.                              See also 
  8527.  
  8528.   Close and Save commands.
  8529.  
  8530. æKY Rez
  8531. æC                       Rez -- resource compiler
  8532.  
  8533. Rez [option…] [file…]  < file ≥ progress
  8534.     -a[ppend]               # merge resource into output resource file
  8535.     -align word | longword  # align resource to word or longword boundries
  8536.     -c[reator] creator      # set output file creator
  8537.     -d[efine] name[=value]  # equivalent to: #define macro [value]
  8538.     -i[nclude] pathname     # path to search when looking for  #include files
  8539.     -m[odification]         # don't change the output file's modification date
  8540.     -o file                 # write output to file (default Rez.Out)
  8541.     -ov                     # ok to overwrite protected resources when appending
  8542.     -p                      # write progress information to diagnostics
  8543.     -rd                     # suppress warnings for redeclared types
  8544.     -ro                     # set the mapReadOnly flag in output
  8545.     -s[earch] pathname      # path to search when looking for INCLUDE resources
  8546.     -t[ype] type            # set output file type
  8547.     -u[ndef] name           # equivalent to: #undef name
  8548.  
  8549. Status codes returned:
  8550.   0    No errors.
  8551.   1    Error in parameters.
  8552.   2    Syntax error in file.
  8553.   3    I/O or program error.
  8554.  
  8555.                            Description
  8556.  
  8557.   Rez compiles the resource fork of a file according to a textual description.
  8558.   The resource description file is a text file that has the same format
  8559.   as the output produced by DeRez, the resource decompiler. The data
  8560.   used to build the resource file can come directly from the resource
  8561.   description file(s) as well as from other text files (via #include
  8562.   and read directives in the resource description file) and from other
  8563.   resource files (via the include directive).
  8564.  
  8565.   Rez includes macro processing, full expression evaluation, and built-in
  8566.   functions and system variables. For information about Rez and the
  8567.   format of a resource description file, see Chapter 11 of the MPW manual. 
  8568.   For a summary of the format of a resource description file, see Appendix D.
  8569.  
  8570.  
  8571.                              Examples
  8572.  
  8573.   Rez Types.r Sample.r -o Sample
  8574.  
  8575.   Generates a resource fork for the file Sample, based on the descriptions
  8576.   in Types.r and Sample.r.
  8577.  
  8578.  
  8579.                              See also 
  8580.  
  8581.   DeRez and RezDet commands.
  8582.  
  8583.   Chapter 11 and Appendix D.
  8584.  
  8585.   Standard resource type declarations in the directory {RIncludes}:
  8586.  
  8587.     • Types.r
  8588.  
  8589.     • SysTypes.r
  8590.  
  8591.     • MPWTypes.r
  8592.  
  8593.     • Pict.r
  8594.  
  8595. æKY RezDet
  8596. æC            RezDet -- detect inconsistencies in resources
  8597.  
  8598. RezDet [option…] file…   > dump
  8599.  -b[ig]                  # read resources one at a time, not all at once
  8600.  -d[ump]                 # write -show information, plus headers, lists, etc.
  8601.  -l[ist]                 # write list of resources with minimum information
  8602.  -q[uiet]                # don't write any output, just set {Status}
  8603.  -r[awdump]              # write -dump information plus contents
  8604.  -s[how]                 # write information about each resource
  8605.  
  8606.  Note: Use at most one of -quiet, -list, -show, -dump, and -rawdump.
  8607.  
  8608. Status codes returned:
  8609.   0    No errors detected.
  8610.   1    Invalid options or no files specified.
  8611.   2    Resource format error detected.
  8612.   3    Fatal error—an I/O or program error was detected.
  8613.  
  8614.                            Description
  8615.  
  8616.   If no options are specified, RezDet investigates the resource fork
  8617.   of each file for damage or inconsistencies. The specified files are
  8618.   read and checked one by one. Output is generated according to the
  8619.   options specified.
  8620.  
  8621.   RezDet checks for the following conditions:
  8622.  
  8623.     • The resource fork is at least the minimum size. (There must
  8624.     be enough bytes to read a resource header.)
  8625.  
  8626.     • There is no overlap or space between the header, the resource
  8627.     data list, and the resource map. There should be no bytes between
  8628.     the EOF and the end of the resource map.
  8629.  
  8630.     • Each record in the resource data list is used once and only
  8631.     once. The last data item ends exactly where the data list ends.
  8632.  
  8633.     • Each item in the resource type list contains at least one reference;
  8634.     each sequence of referenced items starts where the previous resource
  8635.     type item’s reference list ended; and each item in the reference
  8636.     list is pointed to by one and only one resource type list item.
  8637.  
  8638.     • There are no duplicates in the resource type list.
  8639.  
  8640.     • Each name in the name list has one and only one reference,
  8641.     and the last name doesn’t point outside the name list.
  8642.  
  8643.     • There are no duplicate names in the name list. Duplicate names
  8644.     cause an advisory warning rather than a true error. This warning
  8645.     is given only if the -s, -d, or -r option is selected.
  8646.  
  8647.     • Each reference list item points to a valid data item and either
  8648.     has a name list offset of –1 or points to a valid name list offset.
  8649.  
  8650.     • Bits 7 (Unused), 1 (Changed), or 0 (Unused) should not be set
  8651.     in the resource attributes.
  8652.  
  8653.     • All names have a nonzero length.
  8654.  
  8655.   Fields are displayed as hexadecimal or decimal for numeric values,
  8656.   or as a hex dump with associated printable Macintosh characters.
  8657.   The characters newline ($0D), tab ($09) and null ($00) are displayed
  8658.   as "¬", "Δ", and ".", respectively.
  8659.  
  8660.     • Note: RezDet does not use the Resource Manager and should not
  8661.     crash, no matter how corrupt the resource fork of the file.
  8662.  
  8663.  
  8664.                              Examples
  8665.  
  8666.   RezDet {SystemFolder}System
  8667.  
  8668.   Checks the System file for damage.
  8669.  
  8670.   RezDet -q Foo || Delete Foo
  8671.  
  8672.   Removes the file Foo if the resource fork is damaged.
  8673.  
  8674.   Limitations Duplicate resource name warnings are generated even if
  8675.   the names belong to resources of different types.
  8676.  
  8677.   The file attributes field in the resource map header is not validated.
  8678.  
  8679.   The Finder-specific fields in the header and resource map header
  8680.   are ignored.
  8681.  
  8682. æKY RotateWindows
  8683. æC       RotateWindows -- send active (frontmost) window to back
  8684.  
  8685. RotateWindows [-r]
  8686.  -r                      # reverse rotation; bring bottom window to front
  8687.  
  8688. Status codes returned:
  8689.   0    No errors.
  8690.   1    Syntax error (error in parameters).
  8691.  
  8692.                            Description
  8693.  
  8694.   RotateWindows places the front MPW window in the back and brings
  8695.   the second window to the front. Multiple calls to RotateWindows rotate
  8696.   through all open MPW windows. RotateWindows brings only MPW windows
  8697.   to the front (desk accessory windows are not rotated). You might
  8698.   want to add this command to a menu, along with a command key equivalent.
  8699.   For example:
  8700.  
  8701.   AddMenu 'Extras' 'RotateWindows/®' 'RotateWindows'
  8702.  
  8703.  
  8704.                              Examples
  8705.  
  8706.   RotateWindows
  8707.  
  8708.   Puts the front MPW window in back, and brings the target MPW window
  8709.   to the front.
  8710.  
  8711.  
  8712.                              See also 
  8713.  
  8714.   StackWindows, SizeWindow, MoveWindow, and ZoomWindow commands.
  8715.  
  8716. æKY Save
  8717. æC                    Save -- save specified windows
  8718.  
  8719. Save [-a | window…]
  8720.  -a                      # save the contents of all windows
  8721.  
  8722. Status codes returned:
  8723.   0    No errors.
  8724.   1    Syntax error.
  8725.   2    Specified window does not exist.
  8726.  
  8727.                            Description
  8728.  
  8729.   Saves the contents of window or a list of windows to disk without
  8730.   closing them. The -a option saves all open windows. Save without
  8731.   any parameters saves the target window (the second window from the
  8732.   front).
  8733.  
  8734.  
  8735.                              Examples
  8736.  
  8737.   Save -a
  8738.  
  8739.   Saves all open windows.
  8740.  
  8741.   Save {Active} {Worksheet}
  8742.  
  8743.   Saves the Worksheet window and the contents of the active window.
  8744.  
  8745.  
  8746.                              See also 
  8747.  
  8748.   Close and Revert commands.
  8749.       
  8750. æKY SaveOnClose
  8751. æC                    SaveOnClose -- set save behavior when closing windows
  8752.  
  8753. SaveOnClose [-a | -d | -n] [window…]
  8754.  -a                  # always save upon close ("Close -y")
  8755.  -d                  # default behavior for Close
  8756.  -n                  # never save upon close ("Close -n")
  8757.  
  8758.                            Description
  8759.                                                                                  
  8760. This command selects an automatic behavior: save, do not save, or ask
  8761. whether to save when closing a window.  The -n option does not turn off 
  8762. the Save menu item, allowing the user to request saving explicitly. 
  8763.                                                                            
  8764.  
  8765. æKY Search
  8766. æC                  Search -- search files for pattern
  8767.  
  8768. Search [-b] [-s | -i] [-nf] [-r] [-q] [-f file] pattern [file…] < file > found
  8769.  -b                 # break "File/Line" from matched pattern
  8770.  -i                 # case insensitive search (overriding {CaseSensitive})
  8771.  -s                 # case sensitive search (overriding {CaseSensitive})
  8772.  -nf                # write "pattern not found" to standard error and set status = 2
  8773.  -ns                # return 0 when pattern not found
  8774.  -q                 # suppress file name and line number in output
  8775.  -r                 # write non-matching line to standard output
  8776.  -sf                # stop at first match
  8777.  -f file            # lines not written to output are put in this file
  8778.  
  8779. Status codes returned:
  8780.   0    No error.
  8781.   1    Syntax error.
  8782.   2    Pattern not found.
  8783.  
  8784.                            Description
  8785.  
  8786.   Searches the input files for lines that contain a pattern and writes
  8787.   those lines to standard output. If no file is given, standard input
  8788.   is searched. When reading from files, the filenames and line numbers
  8789.   of matching lines are prepended to each line of output.
  8790.  
  8791.   Pattern (defined in "Pattern Matching" in Chapter 6 of the MPW manual and 
  8792.   in Appendix B) is a regular expression, optionally enclosed in forward 
  8793.   slashes ( / ).
  8794.  
  8795.  
  8796.                              Examples
  8797.  
  8798.   Search /procedure/ Sample.p
  8799.  
  8800.   Searches the file Sample.p for the pattern "procedure". All lines
  8801.   containing this pattern are written to standard output.
  8802.  
  8803.   Search /Export/ {MPW}StartUp {MPW}UserStartUp
  8804.  
  8805.   Lists the Export commands in the StartUp and UserStartup files.
  8806.  
  8807.   Search /PROCEDURE [a-zA-Z0-9_]*;/ {PInterfaces}≈
  8808.  
  8809.   Searches for the procedures with no parameters in the Pascal interface
  8810.   files supplied with MPW Pascal. Because more than one input file
  8811.   is specified, a filename will precede each line in the output.
  8812.  
  8813.   Search -f file.nonmatch /pattern/ file
  8814.  
  8815.   All lines of "file" that contain "pattern" are written to standard
  8816.   output. All other lines will be placed in file.nonmatch. This, in
  8817.   effect, splits the file in two pieces, using "pattern" as the key.
  8818.  
  8819.   Search -r -f file.nonmatch /pattern/ file
  8820.  
  8821.   This does the opposite of the preceding example. All lines that do
  8822.   not contain "pattern" are echoed to standard output, and all other
  8823.   lines (that is, those containing "pattern") are written to file.nonmatch.
  8824.  
  8825.  
  8826.                              See also 
  8827.  
  8828.   Find command.
  8829.  
  8830.   "Pattern Matching (Using Regular Expressions)" in Chapter 6.
  8831.  
  8832. æKY Set
  8833. æC               Set -- define or write Shell variables
  8834.  
  8835. Set [name [value]]   > variableList
  8836.  
  8837. Status codes returned:
  8838.   0    No error.
  8839.   1    Syntax error.
  8840.   2    Variable "name" does not exist.
  8841.  
  8842.                            Description
  8843.  
  8844.   Set assigns the string value to the variable name. If value is omitted,
  8845.   Set writes the name and its current value to standard output. If
  8846.   both name and value are omitted, Set writes a list of all variables
  8847.   and their values to standard output. (This output is in the form
  8848.   of Set commands.)
  8849.  
  8850.     • Note: To make variable definitions available to enclosed scripts
  8851.     and programs, you must use the Export command.
  8852.  
  8853.  
  8854.                              Examples
  8855.  
  8856.   Set CIncludes "{MPW}CFiles:CIncludes:"
  8857.  
  8858.   Redefines the variable CIncludes.
  8859.  
  8860.   Set CIncludes
  8861.  
  8862.   Displays the new definition of CIncludes.
  8863.  
  8864.   Set Commands ∂
  8865.   ":,{MPW}Tools:,{MPW}Applications:,{MPW}ShellScripts:"
  8866.  
  8867.   Redefines the variable {Commands} to include the directory "{MPW}ShellScripts:".
  8868.   (See Chapter 5 for a complete list of predefined variables.)
  8869.  
  8870.   Set > SavedVariables
  8871.   # ... other commands
  8872.   Execute SavedVariables
  8873.  
  8874.   Writes the values of all variables to file SavedVariables. Because
  8875.   the output of Set is actually Set commands, the file can be executed
  8876.   later to restore the saved variable definitions. This technique is
  8877.   used in the Suspend and Resume scripts to save and restore variable
  8878.   definitions, as well as exports, aliases, and menus.
  8879.  
  8880.  
  8881.                              See also 
  8882.  
  8883.   Export, Unexport, and Unset commands.
  8884.  
  8885.   "Defining and Redefining Variables" in Chapter 5.
  8886.  
  8887.   "The Startup and UserStartup Files" in Chapter 5.
  8888.  
  8889. æKY SetDirectory
  8890. æC             SetDirectory -- set the default directory
  8891.  
  8892. SetDirectory directory
  8893.  
  8894. Status codes returned:
  8895.   0    Successful completion.
  8896.   1    Parameter error or unable to set directory.
  8897.  
  8898.                            Description
  8899.  
  8900.   SetDirectory sets the default directory and adds the new default
  8901.   directory to the Directory menu if it is not already present. The
  8902.   directory parameter must be specified.
  8903.  
  8904.     • Note: Directory names should not contain any of the special
  8905.     characters shown below. These characters all have special meaning
  8906.     when they appear in menu items:
  8907.  
  8908.   - ; ^ ! < / (
  8909.  
  8910.   The SetDirectory script is used to implement the Set Directory menu
  8911.   item in the Directory menu.
  8912.  
  8913.  
  8914.                              Examples
  8915.  
  8916.   SetDirectory {MPW}Scripts:
  8917.  
  8918.   Sets the default directory to the Scripts folder in the {MPW} directory
  8919.   and adds {MPW}Scripts: to the Directory menu if it’s not already
  8920.   there.
  8921.  
  8922.   SetDirectory…
  8923.  
  8924.   Uses the Commando dialog box to select the default directory interactively.
  8925.  
  8926.  
  8927.                              See also 
  8928.  
  8929.   Directory, DirectoryMenu, and Files commands.
  8930.  
  8931. æKY SetFile
  8932. æC                   SetFile -- set file/folder attributes
  8933.  
  8934. SetFile [option…] file/folder…
  8935.  -a attributes         # attributes (lowercase = 0, uppercase = 1)
  8936.  -c creator            # file creator
  8937.  -d date               # creation date (mm/dd/yy [hh:mm[:ss] [AM | PM]])*
  8938.  -l h,v                # ICON location (horizontal,vertical)*
  8939.  -m date               # modification date (mm/dd/yy [hh:mm[:ss] [AM | PM]])*
  8940.  -t type               # file type
  8941.  
  8942.  Note: Period (.) represents the current date and time.
  8943.  Note: The following attributes may be used with the -a option:
  8944.      L   Locked
  8945.      V   Invisible*
  8946.      B   Bundle
  8947.      S   System
  8948.      I   Inited*
  8949.      D   Desktop*
  8950.      M   Shared (can run multiple times)
  8951.      A   Always switch launch (if possible)
  8952. *Note: Options/attributes marked with an asterisk (*) are allowed with folders
  8953.  
  8954. Status codes returned:
  8955.   0    The attributes for all files were set.
  8956.   1    Syntax error.
  8957.   2    An error occurred.
  8958.       
  8959.  
  8960.                            Description
  8961.  
  8962.   Sets attributes for one or more files. The options apply to all files
  8963.   listed.
  8964.  
  8965.  
  8966.                              Examples
  8967.  
  8968.   SetFile -c "MPS " -t MPST ResEqual
  8969.  
  8970.   Sets the creator and type for the MPW Pascal tool ResEqual.
  8971.  
  8972.   SetFile Foo -m "2/15/86 2:25"
  8973.  
  8974.   Sets the modification date of file Foo.
  8975.  
  8976.   SetFile Foo Bar -m .
  8977.  
  8978.   Sets the modification date to the current date and time (the period
  8979.   is a parameter to -m, indicating current date and time). Setting
  8980.   the date is useful, for instance, before running Make.
  8981.  
  8982.  
  8983.                              See also 
  8984.  
  8985.   Files command. (The -l and -x options display file information.)
  8986.  
  8987. æKY SetPrivilege
  8988. æC  SetPrivilege -- set access privileges for directories on file servers
  8989.  
  8990. SetPrivilege [option…] directory…  > information
  8991.     -d privileges           # set privileges for seeing directories
  8992.     -f privileges           # set privileges for seeing files
  8993.     -g group                # make the directories belong to group
  8994.     -i                      # return information on directories
  8995.     -m privileges           # set privileges for making changes
  8996.     -o owner                # make owner the owner of directories
  8997.     -r                      # operate (set or list) recursively
  8998.  
  8999.     Note: The following privilege characters may be used with
  9000.     the -d, -f, or -m options (Upper case enables the privilege,
  9001.     lower case disables it):
  9002.          O   Owner
  9003.          G   Group
  9004.          E   Everyone
  9005.  
  9006. Status codes returned:
  9007.   0    No error.
  9008.   1    Syntax error.
  9009.   2    Folder not found, or folder not an AppleShare folder.
  9010.   3    User is not owner; could not modify privileges.
  9011.  
  9012.                            Description
  9013.  
  9014.   Using SetPrivilege is equivalent to using the access privileges desk
  9015.   accessory. Priv is a character string (one, two or three characters
  9016.   long) that specifies privileges for the owner, the group, and everyone
  9017.   (o, g, and e, respectively). An uppercase letter enables the privilege;
  9018.   a lowercase letter disables the privilege. If a specific character
  9019.   is not in the string, the respective privilege is not changed.
  9020.  
  9021.  
  9022.                              Examples
  9023.  
  9024.   SetPrivilege -r -f OGe -d OGe -m Oge ∂
  9025.   "Server:personal:peter"
  9026.  
  9027.   This gives everyone in your group the ability to see files within
  9028.   Server:personal:peter without being able to change them. Anyone outside
  9029.   the group cannot see the files or folders or make changes. The owner
  9030.   can do everything.
  9031.  
  9032.   Here is the easiest way to use the SetPrivilege command: Use the
  9033.   -i option to get information on folders and edit the privileges as
  9034.   desired. Then execute the resulting command. For example, to change
  9035.   the privileges for Server:Private, follow these steps:
  9036.  
  9037.   1. Execute this command to obtain the current privileges:
  9038.  
  9039.   SetPrivilege -i Server:Private
  9040.  
  9041.   SetPrivilege Server:Private -o Joe -g Team -d OGE -f OGE -m OGE
  9042.  
  9043.     • Note: These privileges show that Joe, the group Team, and everyone
  9044.     else has all privileges to the folder Private.
  9045.  
  9046.   2. Now edit the output, adjusting the privileges as desired. For
  9047.   example,
  9048.  
  9049.   SetPrivilege Server:Private -o Joe -g Team -d Oge -f Oge -m Oge
  9050.  
  9051.     • Note: Now only Joe, the owner, can see directories and files.
  9052.     Only Joe can make changes; all other users have no privileges.
  9053.  
  9054.   3. Execute the resulting command.
  9055.  
  9056. æKY SetVersion
  9057. æC          SetVersion -- maintain version and revision number
  9058.  
  9059. SetVersion [option…] file  > output ≥ progress
  9060.  -b                    # increment the bug fix component by 1
  9061.  -country name         # country code name
  9062.  -csource file         # update the #define Version string in C source
  9063.  -d                    # display (updated) version numbers to standard output
  9064.  -fmt nƒ.mƒ            # format version numbers according to specification
  9065.  -i resid              # use specified resource id instead of 0
  9066.  -p                    # write SetVersion's version info to diagnostic file
  9067.  -prefix prefix        # prefix version with specified prefix
  9068.  -[p]source file       # update the Version string constant in Pascal source
  9069.  -r                    # increment the revision component by 1
  9070.  -rezsource file       # update the resource definition in Rez source
  9071.  -sb bugfix            # set the bug fix component to the specified value
  9072.  -sr revision          # set the revision component to the specified value
  9073.  -stage stage          # set release stage for a 'vers' resource
  9074.  -suffix suffix        # suffix the version with specified suffix
  9075.  -sv version           # set the version component to the specified value
  9076.  -sx nonrel            # set the non-release component to the specified value
  9077.  -sync 1 | 2           # synchronize 'vers',1 with 'vers',2 or vice versa
  9078.  -t type               # use specified resource type
  9079.  -v                    # increment the version component by 1
  9080.  -verid identifier     # use C/Pascal source version id instead of "Version"
  9081.  -version fmtstring    # alternate way of specifying version component actions
  9082.  -verstring longstring # set the long version string of a Finder 'vers' resource
  9083.  -x                    # increment the non-release component by 1
  9084.  
  9085. Status codes returned:
  9086.   0    Normal termination.
  9087.   1    Parameter or option error.
  9088.  
  9089.                            Description
  9090.  
  9091.   SetVersion generates and maintains (sets or increments) the individual
  9092.   components making up a version number for a file. There are two forms
  9093.   of version numbering supported by SetVersion:
  9094.  
  9095.   ver.rev The first version numbering form is "ver.rev", where ver
  9096.   is a version number and rev a revision number. The component values
  9097.   are kept in a private resource generated and maintained by SetVersion
  9098.   itself. The resource is generally used only by applications (for
  9099.   example, in their About box) and MPW tools (for example, when an
  9100.   MPW tool’s -p option is used) that contain code to read the resource.
  9101.   It is also recognized by Commando to be displayed just below the
  9102.   Do It button of a Commando dialog box1.
  9103.  
  9104.   In this form of version numbering, the resource is maintained as
  9105.   a Pascal string with the resource type 'MPST' and a resource ID of
  9106.   0 (you can use the -t and -i options to specify another resource
  9107.   type and ID number if desired). The resource has the following layout
  9108.   (described as Rez input):
  9109.  
  9110.  
  9111.                              Examples
  9112.  
  9113.   setversion -d -sv 1 -r Example -psource Globals -rezsource Example.r
  9114.  
  9115.   The MPW tool Example contains a SetVersion 'MPST' string resource.
  9116.   The above command line increments the revision for the tool (-r)
  9117.   in the resource fork of the file Example. The version is fixed at
  9118.   1 (-sv), so that Example displays the version and revision as "1.rev".
  9119.   The Pascal include file, Globals, contains the tool’s global declarations,
  9120.   including the Version string. This include file is updated to match
  9121.   the 'MPST' resource (-psource). The resource definitions for the
  9122.   tools, in Example.r, will be similarly updated (-rezsource). Finally,
  9123.   this command displays the new version of the standard output file
  9124.   (-d).
  9125.  
  9126.   setversion -d -version 1.Δ Example -psource Globals -rezsource Example.r
  9127.  
  9128.   Same as previous example, but here we illustrate how the -version
  9129.   option serves the same purpose as the -sv and -r options. Here the
  9130.   "Δ" indicates that the revision is to be incremented.
  9131.  
  9132.   setversion -d -version 1.2.%bΔ Example -psource Globals ∂
  9133.   -rezsource Example.r
  9134.  
  9135.   Again an 'MPST' SetVersion string resource is to be generated. But
  9136.   here we use a more complex version number. The version is set to
  9137.   1, the revision to 2, the bug fix level is left alone ("%"), this
  9138.   is a beta (b) release, and finally the nonrelease level is to be
  9139.   incremented.
  9140.  
  9141.   SetVersion SetVersion -psource SetVersion.p -version 3.Δ -t vers -i 1 ∂
  9142.   -d -verstring "^, ©Apple Computer, Inc. 1984-1988, by Ira L. Ruben"
  9143.  
  9144.   SetVersion SetVersion -version 3.0b1 -t vers -i 2 -verstring "MPW
  9145.   3.0b1"
  9146.  
  9147.   This pair of SetVersion commands generates both Finder 'vers',1 and
  9148.   'vers',2 resources. The Finder Get Info display shown earlier illustrates
  9149.   the result of using these commands. The MPW tool, SetVersion, has
  9150.   its own version number, 3.Δ (the revision is incremented for version
  9151.   3) set as a 'vers',1 resource (-t 'vers', -i 1). A long version message
  9152.   is specified by the -verstring option. The version number from the
  9153.   short message string is inserted into the long string at the position
  9154.   indicated by the "^" character. The generated version number is displayed
  9155.   to the standard output (-d) file. It is also used to update the Pascal
  9156.   source file constant (-psource).
  9157.  
  9158.   The second SetVersion command set the 'vers',2 resource (-t 'vers',
  9159.   -i 2). The version is set unconditionally to 3.0b1 and the long message
  9160.   string to "MPW 3.0b1". MPW 3.0b1 is the MPW release, and SetVersion
  9161.   is just one of the files that belong to this release.
  9162.  
  9163.   The last example illustrates how both 'vers' resources should be
  9164.   used. The 'vers',1 resource is the individual file version while
  9165.   the 'vers',2 is the version release of a product that "owns" the
  9166.   file. The last example also should give some idea of how to arrange
  9167.   makefiles, specifically makefile macro definitions, to make the version
  9168.   numbering automatic and general. The following example illustrates
  9169.   this. It is the actual macro definitions and the SetVersion calls
  9170.   used to build SetVersion itself. They are taken as is from SetVersion’s
  9171.   makefile.
  9172.  
  9173.   MPWversion = 3.0b1                # product release version
  9174.   Copyright = ©Apple Computer, Inc. # copyright notice
  9175.   ver2 = MPW {MPWversion}           # long msg string for 'ver',2
  9176.   ver1 = ^, {Copyright}             # long msg string for 'ver',1
  9177.   - - -
  9178.  
  9179.   SetVersionVer = -sv 3 -r          # SetVersion's component controls
  9180.   Stage = -stage rel -sb 0          # Stage used by tools in makefile
  9181.   - - -
  9182.  
  9183.   SetVersion {LinkedTools}SetVersion -psource {ToolsDir}SetVersion.p ∂
  9184.   {SetVersionVer} -t vers -i 1 {stage} -d ∂
  9185.                   -verstring "{ver1} 1984-1988, by Ira L. Ruben"
  9186.  
  9187.   SetVersion {LinkedTools}SetVersion -version {MPWversion} -t vers ∂
  9188.              -i 2 -verstring "{ver2}"
  9189.   - - -
  9190.  
  9191.   The macro definitions specify the common aspects of the build; that
  9192.   is,
  9193.  
  9194.     • {MPWVersion}—the MPW release (which can be changed by a Make -d
  9195.     option when Make is called).
  9196.  
  9197.     • {Copyright}—the copyright string (which is concatenated into
  9198.     the 'vers',1 long message string).
  9199.  
  9200.     • {ver1}—the long string for the 'vers',2 resource (note it uses
  9201.     the MPW release string—we could have used a "^" here), which
  9202.     is to be displayed at the top of the Finder’s Get Info window.
  9203.  
  9204.     • {ver2}—the long string for the 'vers',1 resource (here we do
  9205.     use the "^"), which is to be displayed as the tools’ individual
  9206.     version number (we use only version and revision numbers).
  9207.  
  9208.     • {SetVersionVer}—a macro that defines the numbering control
  9209.     for the individual tool (the makefile is used to make other tools
  9210.     so there is one of these for each individual tool made).
  9211.  
  9212.     • {Stage}—Used just to insure that only ver.rel is generated
  9213.     in the 'vers',1 resource.
  9214.  
  9215.   The two SetVersion calls are similar to the previous example, but
  9216.   here they are part of a makefile, and we use the macros.
  9217.  
  9218.   1 Commando only uses the SetVersion string resource if a "VersionDialog"
  9219.   is specified as part of the Commando resources. If omitted, Commando
  9220.   will look for a 'vers' resource(s).
  9221.  
  9222.   2 When Commando uses a 'vers' resource, it first will look for a
  9223.   'vers' ,1 resource, and if not present, a 'vers' ,2 resource. The
  9224.   short version string is displayed below the Do It button. Clicking
  9225.   this version number causes the long version string to be displayed
  9226.   in the "help" box. The two 'vers' resources as well as the strings
  9227.   they contain are described when the 'vers' resource format is described.
  9228.  
  9229.   3 The comparison of the BCD field is only valid if the version number
  9230.   components don’t exceed the limitations imposed by the resource.
  9231.   Specifically, the version and nonrelease values are limited to two
  9232.   BCD digits, while the revision and bug fix values are limited to
  9233.   one digit. Because of these limitations, SetVersion does not use
  9234.   the BCD value. SetVersion does, however, place the low-order digits
  9235.   of the actual version components (maintained in the short message)
  9236.   into the BCD fields. The BCD field is thus valid until the version
  9237.   counts exceed the corresponding BCD limitations.
  9238.  
  9239.   4 See the -t option for a summary of which options are valid as a
  9240.   function of which resource (SetVersion’s string or Finder’s 'vers'
  9241.   resource) is being manipulated.
  9242.  
  9243.   5 The country names are spelled exactly as specified in Inside Macintosh
  9244.   for the International Utilities.
  9245.  
  9246. æKY Shift
  9247. æC         Shift -- renumber command file positional parameters
  9248.  
  9249. Shift [number]
  9250.  
  9251. Status codes returned:
  9252.   0    Success.
  9253.   1    Syntax error.
  9254.  
  9255.                            Description
  9256.  
  9257.   Shift renames the command script positional parameters {number+1},
  9258.   {number+2}… to {1}, {2}, and so on. If number is not specified, the
  9259.   default value is 1. Parameter 0 (the command name) is not affected.
  9260.   The variables {Parameters}, {Parameters}, and {#} variables are also
  9261.   modified to reflect the new parameters.
  9262.  
  9263.  
  9264.                              Examples
  9265.  
  9266.   The following script repeats a command once for each parameter:
  9267.  
  9268.   ### Repeat - Repeat a command for several parameters ###
  9269.   #
  9270.   #         Repeat command parameter…
  9271.   #         Execute command once for each parameter in the
  9272.   #         parameter list. You can specify options by
  9273.   #         including them in quotes with the command name.
  9274.   #
  9275.   Set d {1}
  9276.   Loop
  9277.     Shift
  9278.     Break If {1} == ""
  9279.     {cmd} "{1}"
  9280.   End
  9281.  
  9282.   In the preceding example, the Shift command is used to step through
  9283.   the parameters. The Break command tells the loop when all the parameters
  9284.   have been used. You might, for example, use the following Repeat
  9285.   script to compile several C programs with progress information:
  9286.  
  9287.   Repeat 'C -p' Sample.c Count.c Memory.c
  9288.  
  9289.  
  9290.                              See also 
  9291.  
  9292.   "Parameters" in Chapter 5.
  9293.       
  9294. æKY ShowSelection
  9295. æC          ShowSelection -- place the selection within an editor window
  9296.  
  9297. ShowSelection [-t | -b | -c | -n lines | -l line] [window]
  9298.  -t                   # place first line of selection at top of window
  9299.  -b                   # place first line of selection at bottom of window
  9300.  -c                   # center the first line within the window
  9301.  -n lines             # place first line of selection lines from the top
  9302.  -l line              # place line at the top of window
  9303.  
  9304. æKY Shutdown
  9305. æC             Shutdown -- power down or restart the machine
  9306.  
  9307. Shutdown [-y | -n | -c] [-r]
  9308.  -y                  # save all modified windows (avoids dialog)
  9309.  -n                  # do not save any modified windows (avoids dialog)
  9310.  -c                  # cancel if a window needs to be saved (avoids dialog)
  9311.  -r                  # restart the machine
  9312.  
  9313. Status codes returned:
  9314.   1    Syntax error.
  9315.   2    Command aborted.
  9316.        Note: Shutdown cannot return a status of 0 because if there are no 
  9317.        errors the command never returns.
  9318.  
  9319.                            Description
  9320.  
  9321.   Shutdown quits MPW and then either shuts down or reboots the Macintosh.
  9322.   The default is shutdown. Before rebooting the computer, the system
  9323.   executes standard quit procedures, asking for confirmation to save
  9324.   modified files, close all windows, and so on.
  9325.  
  9326.     • Note: Under MultiFinder, Shutdown does not give other active
  9327.     applications the chance to save their documents.
  9328.  
  9329.  
  9330.                              Examples
  9331.  
  9332.   Shutdown -y
  9333.  
  9334.   Shuts down the machine, answering "Yes" to any dialogs such as those
  9335.   prompting to save files.
  9336.  
  9337.  
  9338.                              See also 
  9339.  
  9340.   Quit command.
  9341.  
  9342. æKY SizeWindow
  9343. æC                  SizeWindow -- set a window's size
  9344.  
  9345. SizeWindow  [h v] [window]
  9346.  h                       # window width (horizontal)
  9347.  v                       # window height (vertical)
  9348.  
  9349. Status codes returned:
  9350.   0    No errors.
  9351.   1    Syntax error (error in parameters).
  9352.   2    The specified window does not exist.
  9353.   3    The h v size specified is too big.
  9354.  
  9355.                            Description
  9356.  
  9357.   Sets the size of the specified window to be h by v pixels, where
  9358.   h and v are nonnegative integers referring to the horizontal and
  9359.   vertical dimensions, in that order. (Use a blank space to separate
  9360.   the numbers h and v on the command line.) The default window is the
  9361.   target (second from the front) window; a specific window can optionally
  9362.   be specified. If the size specified would cause the window to be
  9363.   too big for the screen, an error is returned.
  9364.  
  9365.  
  9366.                              Examples
  9367.  
  9368.   SizeWindow 200 200
  9369.  
  9370.   Makes the target window 200 pixels square in size.
  9371.  
  9372.   SizeWindow {Active}
  9373.  
  9374.   A SizeWindow command with no parameters displays the size of the
  9375.   specified window:
  9376.  
  9377.   SizeWindow 500 100 {Worksheet}
  9378.  
  9379.   Makes the Worksheet window 500 x 100 pixels in size.
  9380.  
  9381.  
  9382.                              See also 
  9383.  
  9384.   MoveWindow, RotateWindows, StackWindows, TileWindows, and ZoomWindow
  9385.   commands.
  9386.  
  9387. æKY Sort
  9388. æC                  Sort -- sort or merge lines of text
  9389.  
  9390. Sort [option…] [files…]
  9391.  -b                      # skip leading blanks of each field
  9392.  -check                  # check if input is sorted (exit code 5 if not).
  9393.  -d                      # sort fields as decimal numbers
  9394.  -f field[,field]        # specify fields to sort on (see below)
  9395.  -fs string              # specify field separator characters
  9396.  -l                      # convert to lowercase before comparison
  9397.  -merge                  # merge pre-sorted input files
  9398.  -o file                 # specify output file, allows sorting-in-place
  9399.  -p                      # print version and progress information
  9400.  -quote                  # handle fields with quotes
  9401.  -stdin                  # place-holder for standard input (acts like a file)
  9402.  -r                      # reverse order of comparison
  9403.  -t                      # sort fields as text (default)
  9404.  -u                      # convert to uppercase before comparison
  9405.  -unique                 # write only unique output lines
  9406.  -x                      # sort fields as hexadecimal numbers (leading '$'
  9407.                          #   or '0x' is ignored)
  9408.  
  9409.  The comma-separated field specifications (following -f) take the forms:
  9410.  
  9411.          [F][.C][-K][bdlqrtux]
  9412.      or  [F][.C][+N][bdlqrtux]
  9413.  
  9414.  'F' is a field number (0=whole line [default], 1=first word, 2=second word…).
  9415.  'C' is the starting column number (from 1), default=1.
  9416.  'K' is the ending column number >= C, default=infinite.
  9417.  'N' is the maximum number of characters in the field, default=infinite.
  9418.  Only one of '-K' or '+N' can be specified.
  9419.  
  9420.  The local modifier characters 'bdlqrtux' have the same meaning on a
  9421.  per-field basis as -b, -d, -l, -q, -r, -t, -u and -x (which take effect
  9422.  globally).
  9423.  
  9424. Status codes returned:
  9425.   0    No errors.
  9426.   1    Syntax error on command line.
  9427.   2    Any other error.
  9428.   4    Out of memory.
  9429.   5    Input is not sorted.
  9430.  
  9431.                            Description
  9432.  
  9433.   Sort sorts or merges the specified files and prints the result on
  9434.   the standard output. If no input files are specified, standard input
  9435.   is assumed.
  9436.  
  9437.   Fields and Field Specifications
  9438.  
  9439.   The -f option (see "Options" ) precedes a comma-separated list of
  9440.   field specifications. Lines are sorted by extracting and comparing
  9441.   the fields in the order specified until a comparison yields inequality.
  9442.   If a field exists in one line but not the other, the line that possesses
  9443.   the field wins. If neither line has a field, the lines are considered
  9444.   equal. Fields not sorted are output randomly (Sort is not a stable
  9445.   sort).
  9446.  
  9447.   Each of the field specifications takes one of the forms:
  9448.  
  9449.   [F][.C][-K][modifiers]
  9450.  
  9451.   [F][.C][+N][modifiers]
  9452.  
  9453.   F is a field number, C and -K are column numbers, and +N is a character
  9454.   count. Any of the items may be omitted, provided that at least one
  9455.   item appears. The numbers -K and +N are mutually exclusive. Spaces
  9456.   can appear anywhere in the specification (except within numbers),
  9457.   but they must be Shell-quoted.
  9458.  
  9459.   Fields are numbered from 1. A field is a string of characters surrounded
  9460.   by newlines or field separator characters (usually whitespace; see
  9461.   the -fs option). Typically field 1 would be the first word on the
  9462.   line, field 2 the second word, and so on. Field 0 represents the
  9463.   entire line and is the default if a field number is not specified.
  9464.   Field separator characters are treated as normal text (not separators)
  9465.   in field 0.
  9466.  
  9467.   Columns are numbered from 1. If .C is specified, it represents a
  9468.   starting offset into the field, taking into account the (file-dependent)
  9469.   varying width of tab characters, if necessary. .C defaults to 1 if
  9470.   it is not specified.
  9471.  
  9472.   If -K is specified it represents the last column to be included in
  9473.   the field. It defaults to infinity (the maximum K possible) if not
  9474.   specified. Except for field 0, fields are always terminated by field-separator
  9475.   characters, so a large K does not mean "the rest of the line."
  9476.  
  9477.   If +N is specified, it represents the number of characters to be
  9478.   included in the field (this differs from -K in that tabs are always
  9479.   counted as single characters). It defaults to infinity (the maximum
  9480.   N possible) if not specified.
  9481.  
  9482.   Here is a short description of all possible field specifications:
  9483.  
  9484.     F         The entirety of field F.
  9485.     F.C       Columns C…∞ in field F.
  9486.     F.C-K     Columns C…K in field F.
  9487.     F.C+N     N characters starting at column C in field F.
  9488.     F-K       Columns 1…K in field F.
  9489.     F+N       The first N characters in field F.
  9490.     .C        Columns C…∞ in the whole line.
  9491.     .C-K      Columns C…K in the whole line.
  9492.     .C+N      N characters starting at column C in the whole line.
  9493.     -K        Columns 1…K in the whole line.
  9494.     +N        The first N characters of the whole line.
  9495.  
  9496.   A field specification may be followed by one or more modifier characters:
  9497.  
  9498.     r         Reverse order of comparison (reverses -r).
  9499.     b         Ignore leading blanks (reverses -b).
  9500.     q         Interpret quotes when extracting field (reverses -quote).
  9501.     d x t l u Treat field as decimal (d), hexadecimal (x), normal text
  9502.               (t), lowercase text (l) or uppercase text (u). These modifiers are
  9503.               mutually exclusive.
  9504.  
  9505.   These modifiers override the corresponding command line options on
  9506.   a field-by-field basis (r, q, and b flip the meaning of -r, -quote,
  9507.   and -b).
  9508.  
  9509.   When sorting multiple files, each file can have its own tab setting.
  9510.   When comparing column-aligned fields, Sort correctly handles tabs
  9511.   of varying width, even when comparing records from different files.
  9512.  
  9513.  
  9514.                              Examples
  9515.  
  9516.   Sort Able -stdin Baker -o Output
  9517.  
  9518.   Sort the files Able, Baker, and the standard input, with output to
  9519.   file Output.
  9520.  
  9521.   Sort -x -f '2.2+8, 1tr' Frog
  9522.  
  9523.   Sort the file Frog. The first key to sort on consists of eight characters
  9524.   starting at the second column of the second field, treated as a hexadecimal
  9525.   number. The second key to sort on is merely the text of the first
  9526.   field, in reverse order.
  9527.  
  9528.   Sort -p -merge -u one two three infinity
  9529.  
  9530.   Merge the specified files, treating lowercase characters as uppercase.
  9531.   Print version and progress information.
  9532.  
  9533. æKY StackWindows
  9534. æC             StackWindows -- arrange windows diagonally
  9535.  
  9536. StackWindows [-h num] [-v num] [-r top,left,bottom,right] [-i] [windows…]
  9537.  -h num                  # horizontal offset between windows
  9538.  -v num                  # vertical offset between windows
  9539.  -r t,l,b,r              # rectangle in which to stack windows
  9540.  -i                      # include the worksheet
  9541.  windows…                # list of windows to tile
  9542.  
  9543. Status codes returned:
  9544.   0    No errors.
  9545.   1    Syntax error (in parameters).
  9546.  
  9547.                            Description
  9548.  
  9549.   Automatically sizes and moves all of the open Shell windows (except
  9550.   the Worksheet) so that they are staggered diagonally across the screen.
  9551.   Use StackWindows when selecting windows from the Window menu; this
  9552.   makes dealing with many open windows easier.
  9553.  
  9554.   If no windows are specified, all open Shell windows (except the Worksheet)
  9555.   are stacked up. Additionally you can specify the horizontal and vertical
  9556.   staggering constants; otherwise staggering defaults to five pixels
  9557.   horizontally and 20 pixels vertically. You can also include the Worksheet
  9558.   by using the -i option.
  9559.  
  9560.  
  9561.                              Examples
  9562.  
  9563.   StackWindows
  9564.  
  9565.   Stacks all of the Shell windows, excluding the Worksheet, in a neat
  9566.   and orderly fashion.
  9567.  
  9568.   StackWindows -i -v 20 -h 10 {active} {target}
  9569.  
  9570.   Stacks the top two windows, including the Worksheet, with a vertical
  9571.   spacing of 20 pixels and a horizontal spacing of 10 pixels.
  9572.  
  9573.  
  9574.                              See also 
  9575.  
  9576.   MoveWindow, RotateWindow, SizeWindow, TileWindows, and ZoomWindow
  9577.   commands.
  9578.       
  9579. æKY StreamEdit
  9580. æC              StreamEdit -- scriptable text editor
  9581.  
  9582. StreamEdit [option…] file…
  9583.     -d                      # delete lines (don't copy them)
  9584.     -e statements           # add 'statements' to the script
  9585.     -o file                 # direct output to file in a "safe" manner
  9586.     -p                      # print progress information
  9587.     -s file                 # specify a file containing a script to execute
  9588.     -set variable[=string]  # set the value of a variable
  9589.  
  9590.     A script consists of zero or more of:
  9591.     
  9592.         <address> <command>…
  9593.  
  9594.     Addresses take the forms (highest to lowest precedence):
  9595.     
  9596.         ( address )             # override precedence
  9597.         ! address               # match line not matching the address
  9598.         address1 && address2    # match line matching address1 AND address2
  9599.         address1 || address2    # match line matching address1 OR address2
  9600.         address1 , address2     # match address1…address2
  9601.         /regular expression/    # a line that matches the expression
  9602.         •                       # matches BEFORE the first line
  9603.         N                       # matches the Nth line
  9604.         $                       # matches the last line
  9605.         ∞                       # matches AFTER the last line
  9606.  
  9607.     A regular expression starting with 'ç' is case-sensitive.  Any '•' must
  9608.     follow the 'ç'.
  9609.  
  9610.     Commands are:
  9611.     
  9612.         Append <text>           # append text to append buffer
  9613.         Exit [status]           # exit with zero or specified status
  9614.         Change <text>           # set contents of edit buffer
  9615.         Delete                  # clear contents of edit buffer
  9616.         Insert <text>           # append text to insert buffer
  9617.         Next                    # proceed with next line
  9618.         Print <text>            # Print the text
  9619.              [-To file ]        #    directed to the specified file
  9620.              [-AppendTo file]   #    appended to the specified file
  9621.         Replace /pat/ <text>    # do replacement
  9622.                 [-c count]      # specify repeat count (N or ∞)
  9623.         Set variable <text>     # set variable's value
  9624.             [-a]                #    append to variable's current value
  9625.             [-i]                #    insert at front of variable's current value
  9626.         Option AutoDelete       # append "1,$ Delete" to script
  9627.     
  9628.     Where <text> consists of zero or more of:
  9629.     
  9630.         "a string"              # the specified text
  9631.         'a string'              # the specified text
  9632.         .                       # the current line (the edit buffer)
  9633.         variableName            # the contents of the named string variable
  9634.         ®N                      # an "®" variable set by a regular expression
  9635.         -from <filename>        # the next line from the file, where filename
  9636.                                 #    is a string or a variable name
  9637.         -n                      # suppress newline at end
  9638.  
  9639.     If <text> is empty, it defaults to "." (the current line).
  9640.             
  9641.                                        Description
  9642.                                                                                              
  9643. StreamEdit is an "offline" text editor similar to the Unix™ tool sed; it provides scriptable 
  9644. text matching and editing operations.  [It is not compatible with Unix™ sed or awk].  It is 
  9645. useful for making repetitive changes to files, for extracting information from text files, or 
  9646. as a filter.
  9647.  
  9648. StreamEdit takes a script and a set of input files (or standard input, if no input files are 
  9649. specified) and applies each statement in the script to each line of input, writing the output 
  9650. to standard output or the specified output file.
  9651.  
  9652. The script is specified by one or more -e or -s options.  If more than one script is 
  9653. specified, the resulting script is the concatenation of all the scripts.  If no script is 
  9654. specified (and -d is not specified), the script effectively defaults to
  9655.  
  9656.      1,$ Print
  9657.  
  9658. which has the effect of simply copying the input lines to the output.
  9659.  
  9660.  
  9661. A script consists of a series of statements of the form:
  9662.  
  9663.      address-expression command [ ; command … ]
  9664.  
  9665. Commands are separated by newlines or semi-colons.  All the commands following a 
  9666. particular address, up to the next address, are executed when the address matches.
  9667.  
  9668. A command takes the form:
  9669.  
  9670.      command-name [ text-arguments … ]
  9671.  
  9672. Arguments are terminated by newlines and semi-colons (while addresses may span 
  9673. multiple lines).
  9674.  
  9675. Address expressions, commands and command arguments are described below.
  9676.  
  9677.  
  9678. Empty lines are legal.  Comments begin with a sharp sign (#).  Semi-colons are equivalent 
  9679. to line breaks (unless they appear as the first character on a line), as in the Shell, and are 
  9680. used to terminate commands.  Newlines (outside of strings) may be escaped to extend an 
  9681. argument list.
  9682.  
  9683. If a script line contains a semi-colon in the first column, the entire line is treated as a 
  9684. comment by StreamEdit.  This allows you to write StreamEdit scripts that also contain 
  9685. MPW shell commands.  See the Examples section for more details.
  9686.  
  9687.                             Examples
  9688.                                                                                     
  9689.              Extracting the Leaf Part of a File Name
  9690.                                        
  9691. It is sometimes necessary to extract the leaf part of a complete file path name in a Shell 
  9692. script.  The StreamEdit expression:
  9693.  
  9694. /(≈:)*([¬:]*)®1/
  9695.  
  9696. sets the variable ®1 to the part of the file name following the last colon, or the whole file 
  9697. name if there it doesn't contain a colon.  It could be used in a Shell script as a filter:
  9698.  
  9699. # {MPW}Scripts:FilterLeaf
  9700. StreamEdit -d -e '/(≈:)*([¬:]*)®1/ print ®1'
  9701.  
  9702. For example:
  9703.  
  9704. Echo "The:I:Is:Silent:myFile" | FilterLeaf
  9705.  
  9706. would print:
  9707.  
  9708. myFile
  9709.  
  9710.  
  9711.                     Generating Inlines
  9712.                                                             
  9713. This is a script that generates MPW C or C++ inline function declarations from assembly 
  9714. language source.  It's far easier and less error-prone than hand-assembly or cut-and-paste; 
  9715. even though this script depends on the format of the listing file produced by the MPW 
  9716. Assembler, it is better to automate the process.
  9717.  
  9718. The script's usage is:
  9719.  
  9720. MakeCInline assemblyfile.a >outputFile
  9721.  
  9722. Given assembler input something like this:
  9723.  
  9724. ;+
  9725. ;  Inline Pascal string copy
  9726. ;
  9727. ;¥ void pascal_string_copy(char* src, char* dest);
  9728. ;
  9729. ;-
  9730.  proc
  9731.  movem.l (SP),A0-A1
  9732.  moveq   #0,D0
  9733.  move.b  (A1),D0
  9734.  bra.s   @2
  9735. @loop:   move.b   (A1)+,(A0)+
  9736. @2: dbra D0,@loop
  9737.  endproc
  9738.  
  9739. We want the filter to produce an inline declaration something like this:
  9740.  
  9741. void pascal_string_copy(char* src, char* dest) =
  9742. {0x4cef, 0x0300, 0x6b00, 0x1011, 0x6002, 0x10d9, 0x51c8, 0xfffc};
  9743.  
  9744. The character '¥' in the assembler comment marks the declaration; in principle any 
  9745. unique character or string can be used to flag the declaration.
  9746.  
  9747.  
  9748. The script has two parts; the first part contains MPW Shell commands, the rest of the 
  9749. script contains StreamEdit statements.
  9750.  
  9751. The MPW Shell part of the script is:
  9752.  
  9753. # MakeCInline -- make C assembly language inline declarations
  9754. ; asm "{1}" -l
  9755. ; StreamEdit -d -s "`which {0}`" "{1}".lst
  9756. ; Delete "{1}".lst "{1}".o
  9757. ; exit
  9758.  
  9759. It runs the assembler on the input file, producing a listing which is processed by the rest 
  9760. of the script.  Then the temporary files are removed and the MPW Shell part of the script 
  9761. exits; the Exit command ensures that the Shell doesn't execute any StreamEdit statements.
  9762.  
  9763. The invocation of StreamEdit here has an interesting hack; the name of the StreamEdit 
  9764. script to execute is, naturally, the name of the currently executing script.  So we use
  9765.  
  9766. `which {0}`
  9767.  
  9768. which expands into the name of the currently running shell script.
  9769.  
  9770.  
  9771. The rest of the file contains a StreamEdit script that processes the assembly listing 
  9772. produced above.  Here's an example of the assembler's listing output:
  9773.  
  9774. MC680xx Assembler - Ver 3.2d1          21-Nov-89  Page   1
  9775. Copyright Apple Computer, Inc. 1984-1989
  9776.  
  9777. Loc   F Object Code     Addr  MSource Statement
  9778.  
  9779.  case on
  9780.  ;+
  9781.  ;
  9782.  ; ¥ void pascal_string_copy(char* src, char* dest)
  9783.  ;
  9784.  ;-
  9785. 00000                       strcpy   proc   export
  9786. 00000   4CD7 0300            movem.l   (SP),A0-A1
  9787. 00004   7000                 moveq   #0,D0   
  9788. 00006   1011                 move.b   (A1),D0
  9789. 00008   6002        0000C    bra.s   @1
  9790. 0000A   10D9                @loop:   move.b   (A1)+,(A0)+
  9791. 0000C G 51C8 FFFC   0000A   @1:   dbra   D0,@loop
  9792. 00010                                endproc
  9793.  
  9794.                                 end
  9795.  
  9796. Elapsed time: 0.08 seconds.
  9797.  
  9798. Assembly complete - no errors found.  16 lines.
  9799.  
  9800.  
  9801.  
  9802. The opcodes we need are tantalizingly close … but embedded in goop that we need to 
  9803. strip away.  The first job is to extract the inline's declaration and copy it to the output.  
  9804. Hex constants must be separated by commas — we accomplish this with a variable, 
  9805. initially empty, that is set to a comma-and-space when a hex constant is emitted, so that a 
  9806. comma precedes every hex constant but the first one.
  9807.  
  9808. /;¥[ ∂t]*([¬;]*)®1/
  9809.  Print -n ®1 " =∂n{"
  9810.  Set PRECEEDING_COMMA ""
  9811.  Delete
  9812.  
  9813. The regular expression matches the inline declaration in the comment (which can be 
  9814. recognized by virtue of the marker string — "¥" — that we put there).  The text of the 
  9815. inline is extracted, omitting a possible trailing semicolon, and put into the variable ®1.  
  9816. The Print statement emits the inline declaration (in ®1) and extra stuff needed for C 
  9817. inline syntax.  The PRECEEDING_COMMA variable is set to empty, the line is deleted, 
  9818. and processing continues.
  9819.  
  9820.  
  9821. The inline declaration is terminated by an ENDP or an ENDPROC assembler directive:
  9822.  
  9823. /[ ∂t]ENDP/
  9824.  Print "};∂n"
  9825.  Delete
  9826.  
  9827. Next, totally uninteresting lines are deleted.  Examining the assembly listing, we note that 
  9828. the lines with the object code we need invariably contain a hex constant starting in the 
  9829. first column, several spaces (with an optional "G"), and at least one two-byte hex constant.  
  9830. We'll strip every line that doesn't meet these criteria, so there will be less noise to worry 
  9831. about.
  9832.  
  9833. !/•[0-9a-f]+ [ g] [0-9a-f]«4»/
  9834.  Delete
  9835.  
  9836. Then we simply delete any junk that precedes the hex constant we're interested in:
  9837.  
  9838. 1,$ Replace /[0-9a-f]+ [g ] /  ""
  9839.  
  9840. Now the line contains one word of assembler output that we can copy to the output:
  9841.  
  9842. /•([0-9a-f]«4»)®1 /
  9843.  Print -n PRECEEDING_COMMA "0x"®1
  9844.  Set PRECEEDING_COMMA ", "
  9845.  Replace // ""
  9846.  
  9847. We print an optional comma, followed by the hex constant itself.  Then we arrange for 
  9848. future constants to be preceded by a comma, and remove the constant from the front of 
  9849. the line.
  9850.  
  9851. Now we have a problem — there's no way to tell how many more constants have to be 
  9852. processed.  Furthermore, StreamEdit has no control structures for looping, so a count 
  9853. wouldn't help much anyway.  So we resort to a hack, namely, repeating the above code as 
  9854. many times as we're likely to ever need it for a single line of assembler output.
  9855.  
  9856. #
  9857. #  Convert remaining words
  9858. #  (I wish StreamEdit had looping!)
  9859. #
  9860. /•([0-9a-f]«4»)®1 /
  9861.  Print -n ", 0x"®1
  9862.  Replace // ""
  9863. /•([0-9a-f]«4»)®1 /
  9864.  Print -n ", 0x"®1
  9865.  Replace // ""
  9866. /•([0-9a-f]«4»)®1 /
  9867.  Print -n ", 0x"®1
  9868.  Replace // ""
  9869. /•([0-9a-f]«4»)®1 /
  9870.  Print -n ", 0x"®1
  9871.  Replace // ""
  9872.  
  9873. Examination of the assembler output shows that handling five constants on a line is more 
  9874. than enough.  However, if the assembler listing format changes, the script will break.
  9875.  
  9876.  
  9877.                       Unpacking Unix Shell Archives
  9878.                                                                   
  9879. This script unpacks a Unix shell archive, more commonly known as a shar file.  Shar files 
  9880. are used in the Unix community to gather text (say, the sources for a program, including 
  9881. its makefile) into a single file, suitable for transmittal by electronic mail or usenet.
  9882.  
  9883. Shar files typically have the form:
  9884.  
  9885. garbage at the beginning — mail headers and so forth
  9886. sed "s/^X//" >TheFile <<'END_OF_TheFile '
  9887. Xtext of the file
  9888. X  where each line
  9889. X    is preceded by an 'X'
  9890. END_OF_TheFile 
  9891. more files, similarly packed
  9892.  
  9893. The Unix shell and the tool sed cooperate to strip off the 'X's at the beginning of each 
  9894. line, and to direct the output to the correct file.  Unfortunately the MPW Shell does not 
  9895. have this kind of redirection, and StreamEdit is not sed, so we have to come up with our 
  9896. own solution.
  9897.  
  9898. To make matters worse, there is no single format for a shar file — in the Unix community 
  9899. it's "anything goes", as long as the standard Unix tools can unpack it.  A StreamEdit script 
  9900. to unpack an arbitrary shar file would have to closely emulate the Unix environment, 
  9901. which is rather difficult.  In practice, you'll have to tweak this script to handle different 
  9902. kinds of shar files.
  9903.  
  9904.  
  9905. The script starts with the usual MPW Shell commands to start up StreamEdit with the 
  9906. proper script, pass along the command-line parameters, and exit.  No surprises:
  9907.  
  9908. ; streamedit -d -s `which "{0}"` {parameters}
  9909. ; exit
  9910.  
  9911.  
  9912. The variable FILE holds the name of the current output file.  When we see a line beginning 
  9913. with "sed", we extract the output filename (possibly enclosed in quotes) and put it in the 
  9914. variable.
  9915.  
  9916. • Set FILE "DELETE.ME"         # for safety's sake
  9917.  
  9918. /•sed/ &&   (   />[ ∂t]*∂'([¬ ∂t]*)®1∂' /   # sed … >'quotedFile'
  9919.   ||
  9920.   />[ ∂t]*([¬ ∂t>]*)®1 /   # sed … >notQuotedFile
  9921.        )
  9922.   Set FILE ®1
  9923.   print "Extracting " FILE
  9924.  
  9925. For paranoia's sake, the FILE variable is initialized to "DELETE.ME", and the name of each 
  9926. file extracted is printed on standard output.
  9927.  
  9928. Extraction is simple — for every line beginning with an "X", the "X" is stripped off and the 
  9929. line is written to the current destination file.
  9930.  
  9931. /•X/
  9932.  replace // ""
  9933.  print -to FILE
  9934.    
  9935.                             See also
  9936.                                                                                           
  9937. Shell documentation on regular expressions.                                                                                          
  9938.    
  9939. æKY Target
  9940. æC              Target -- make a window the target window
  9941.  
  9942. Target name
  9943.  
  9944. Status codes returned:
  9945.   0    No errors.
  9946.   1    Error in parameters.
  9947.   2    The specified file does not exist.
  9948.   3    System error.
  9949.  
  9950.                            Description
  9951.  
  9952.   Makes window name the target window for editing commands (that is,
  9953.   the second window from the front). If window name isn’t already open,
  9954.   then file name is opened as the target window. If name doesn’t exist,
  9955.   an error is returned.
  9956.  
  9957.  
  9958.                              Examples
  9959.  
  9960.   Target Sample.a
  9961.  
  9962.   Makes the window Sample.a the target window.
  9963.  
  9964.  
  9965.                              See also 
  9966.  
  9967.   Open command.
  9968.  
  9969.   "Editing With the Command Language" in Chapter 5.
  9970.  
  9971. æKY TileWindows
  9972. æC          TileWindows -- arrange windows in a tiled fashion
  9973.  
  9974. TileWindows [-h | -v] [-r top,left,bottom,right] [-i] [windows…]
  9975.  -h                      # tile windows horizontally
  9976.  -v                      # tile windows vertically
  9977.  -r t,l,b,r              # rectangle in which to tile windows
  9978.  -i                      # include the worksheet
  9979.  windows…                # list of windows to tile
  9980.  
  9981. Status codes returned:
  9982.   0    No errors.
  9983.   1    Syntax error (error in parameters).
  9984.  
  9985.                            Description
  9986.  
  9987.   TileWindows automatically sizes and moves the specified Shell windows
  9988.   so that they are all visible on the screen at once. If no windows
  9989.   are specified, all open windows are tiled (except the Worksheet).
  9990.   Arranging your open windows like tiles and then zooming a selected
  9991.   window to full size makes dealing with many open windows much easier.
  9992.  
  9993.  
  9994.                              Examples
  9995.  
  9996.   TileWindows
  9997.  
  9998.   Arranges all of the Shell windows in a tile pattern, so that all
  9999.   are visible.
  10000.  
  10001.   TileWindows -h hd:new:main.c hd:new:foo.c
  10002.  
  10003.   Arranges the specified windows as two long horizontal strips.
  10004.  
  10005.   TileWindows -v {active} {target}
  10006.  
  10007.   Arranges the top two windows vertically.
  10008.  
  10009.  
  10010.                              See also 
  10011.  
  10012.   MoveWindow, RotateWindow, SizeWindow, StackWindows, and ZoomWindow
  10013.   commands.
  10014.  
  10015. æKY TransferCkid
  10016. æC  TransferCkid -- move Projector information from one file to another
  10017.  
  10018. TransferCkid sourceFile destinationFile 
  10019.  
  10020. Status codes returned:
  10021.   0    No errors.
  10022.   1    Syntax error.
  10023.   2    Error in processing.
  10024.  
  10025.                            Description
  10026.  
  10027.   Move the Projector 'CKID' resource from sourcefile to destinationfile.
  10028.  
  10029.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  10030.   symbols used in Projector commands.
  10031.  
  10032. æKY Translate
  10033. æC                  Translate -- translate characters
  10034.  
  10035. Translate [-p] [-s] src [dst] < file > output ≥ progress
  10036.     -p                    # write progress information to diagnostics
  10037.     -s                    # set font, font size, and tab setting of output
  10038.  
  10039. Status codes returned:
  10040.   0    Normal termination.
  10041.   1    Parameter or option error.
  10042.  
  10043.                            Description
  10044.  
  10045.   Standard input is copied to standard output, with input characters
  10046.   specified in the src (source) parameter string mapped into the corresponding
  10047.   characters specified by the dst (destination) parameter string; all
  10048.   other characters are copied as is. If dst is omitted, all characters
  10049.   represented by the src are deleted. If the dst string is shorter
  10050.   than the src, all characters in the src that would map to or beyond
  10051.   the last character in the dst are mapped into the last character
  10052.   in dst, and adjacent instances of such characters in the input are
  10053.   represented by a single instance of the last character in dst.
  10054.  
  10055.   Both src and dst are specified as a standard Shell character list
  10056.   but not enclosed in square brackets. Thus the src and dst are sequences
  10057.   of one or more characters (that is, an abcde) or a range of characters
  10058.   separated by a minus sign (that is, a–z, 0–9). Standard escape characters
  10059.   (such as ,
  10060.  
  10061.     • Note: Case sensitivity of letters specified in the src list
  10062.     are governed by the {CaseSensitive} Shell variable. If CaseSensitive
  10063.     is set to 1, then only letters specified in the src are mapped
  10064.     or deleted. If CaseSensitive is 0, then uppercase and lowercase
  10065.     letters not explicitly mapped into dst characters are mapped
  10066.     identically.
  10067.  
  10068.  
  10069.                              Examples
  10070.  
  10071.   translate a-z A-Z <origFile >ucFile
  10072.  
  10073.   Converts all lowercase letters in origFile to uppercase and writes
  10074.   the translated file to ucFile.
  10075.  
  10076.   translate 0-9 9 <origFile >outFile
  10077.  
  10078.   Converts each string of digits in origFile to the single digit 9
  10079.   in outFile.
  10080.  
  10081.   translate  
  10082.  
  10083.   Converts each run of blanks, tabs, or newline (return) characters
  10084.   in origFile to a single newline character in outFile. This effectively
  10085.   produces an output with just one word on each line. Note that the
  10086.   src string had to be quoted to specify the blank.
  10087.  
  10088.   translate ¬a-zA-Z    <origFile >outFile
  10089.  
  10090.   Removes all punctuation and isolates words by spaces on each line.
  10091.   Here we negated the src character list. Thus all characters except
  10092.   letters and newline characters are replaced with spaces.
  10093.  
  10094. æKY Unalias
  10095. æC                      Unalias -- remove aliases
  10096.  
  10097. Unalias [name…]
  10098.  
  10099. Status codes returned:   
  10100.   0    no errors.
  10101.  
  10102.                            Description
  10103.  
  10104.   Removes any alias definition associated with the alias name. (It
  10105.   is not an error if no definition exists for name.)
  10106.  
  10107.   s Caution If no names are specified, all aliases are removed.  s
  10108.  
  10109.   The scope of the Unalias command is limited to the current script;
  10110.   that is, aliases in enclosing scripts are not affected. If you are
  10111.   writing a script that is to be completely portable across various
  10112.   users’ configurations of MPW, you should place the command
  10113.  
  10114.   Unalias
  10115.  
  10116.   at the beginning of your script to make sure no unwanted substitutions
  10117.   occur.
  10118.  
  10119.  
  10120.                              Examples
  10121.  
  10122.   Unalias File
  10123.  
  10124.   Remove the alias "File". (This alias is defined in the Startup file.)
  10125.  
  10126.  
  10127.                              See also 
  10128.  
  10129.   Alias command.
  10130.  
  10131.   "Command Aliases" in Chapter 5.
  10132.  
  10133. æKY Undo
  10134. æC                     Undo -- undo the last edit
  10135.  
  10136. Undo [window]
  10137.  
  10138. Status codes returned:
  10139.   0    No errors.
  10140.   1    Syntax error (error in parameters).
  10141.   2    Any other error.
  10142.  
  10143.                            Description
  10144.  
  10145.   Undo is the scriptable equivalent of choosing Undo from the Edit
  10146.   menu to reverse the last editing operation. Undo without any parameters
  10147.   acts on the target (that is, the second from the front) window. Optionally
  10148.   a named window can be specified.
  10149.  
  10150.     • Note: Remember that Undo is maintained on a window-by-window
  10151.     basis. Therefore using this command will undo the last edit operation
  10152.     that was performed in the specified window, which may or may
  10153.     not be the last operation actually performed.
  10154.  
  10155.  
  10156.                              Examples
  10157.  
  10158.   Undo
  10159.  
  10160.   Reverses the last edit operation in the target window.
  10161.  
  10162.   Undo {Worksheet}
  10163.  
  10164.   Reverses the last edit operation in the Worksheet window.
  10165.  
  10166.  
  10167.                              See also 
  10168.  
  10169.   Cut, Copy, and Paste commands.
  10170.  
  10171. æKY Unexport
  10172. æC     Unexport -- remove variable definitions from the export list
  10173.  
  10174. Unexport [-r | -s | name…]   > unexports
  10175.  -r                      # generate Export commands for all unexported variables
  10176.  -s                      # print the names only
  10177.  
  10178. Status codes returned:
  10179.   0    No error.
  10180.   1    Syntax error.
  10181.  
  10182.                            Description
  10183.  
  10184.   Removes the specified variables from the list of exported variables.
  10185.   The list of exported variables is local to a script, so unexported
  10186.   variables are removed only from the local list.
  10187.  
  10188.   If no names are specified, a list of unexported variables is written
  10189.   to standard output. The default output of Unexport is in the form
  10190.   of Unexport commands.
  10191.  
  10192.   (A variable that is not exported is considered unexported.)
  10193.  
  10194.  
  10195.                              Examples
  10196.  
  10197.   Set SrcDir HD:source:
  10198.   Export SrcDir # SrcDir is available to scripts and tools
  10199.   …
  10200.   Unexport SrcDir
  10201.  
  10202.   Now the variable SrcDir is no longer available to scripts and tools.
  10203.  
  10204.   Unexport -r
  10205.   Export var1
  10206.   Export var2
  10207.   …
  10208.  
  10209.   This example lists all the variables that are not exported. To export
  10210.   them, simply select and execute all the export commands.
  10211.  
  10212.   To get a list of all the variables that have not been exported, execute
  10213.   this command:
  10214.  
  10215.   Unexport -s
  10216.   var1
  10217.   var2
  10218.   ...
  10219.   varx
  10220.  
  10221.  
  10222.                              See also 
  10223.  
  10224.   Set and Export commands.
  10225.  
  10226. æKY Unmark
  10227. æC               Unmark -- remove a marker from a window
  10228.  
  10229. Unmark name… window
  10230.  
  10231. Status codes returned:
  10232.   0    No errors.
  10233.   1    Syntax error.
  10234.   2    Error in processing.
  10235.   3    System error.
  10236.  
  10237.                            Description
  10238.  
  10239.   Unmark removes the marker(s) name… , from the list of markers available
  10240.   for window. When a window is the current active window, the Mark
  10241.   menu item(s) will be adjusted.
  10242.  
  10243.  
  10244.                              Examples
  10245.  
  10246.   Unmark `Markers` {Target}
  10247.  
  10248.   Removes all markers associated with the target window.
  10249.  
  10250.   Unmark Proc1 {Active}
  10251.  
  10252.   Removes the "Proc1" marker from the active window’s marker list.
  10253.   Because {Active} is by definition the current active window, the
  10254.   Mark menu is also adjusted to reflect the deletion of the "Proc1"
  10255.   marker.
  10256.  
  10257.   Limitation Unmark does not support Undo.
  10258.  
  10259.  
  10260.                              See also 
  10261.  
  10262.   "Markers" in Chapter 6.
  10263.  
  10264. æKY Unmount
  10265. æC                     Unmount -- unmount volumes
  10266.  
  10267. Unmount volume…
  10268.  
  10269. Status codes returned:
  10270.   0    The volume was successfully unmounted.
  10271.   1    Syntax error.
  10272.   2    An error occurred.
  10273.  
  10274.                            Description
  10275.  
  10276.   Unmounts the specified volumes. A volume name must end with a colon
  10277.   ( : ). If volume is a number without a colon, it’s interpreted as
  10278.   a disk drive number. The unmounted volumes cannot be referenced again
  10279.   until remounted. If you unmount the current volume (the volume containing
  10280.   the current directory), the boot volume becomes the current volume.
  10281.  
  10282.  
  10283.                              Examples
  10284.  
  10285.   Unmount Memos:
  10286.  
  10287.   Unmounts the volume titled Memos.
  10288.  
  10289.   Unmount 1 2
  10290.  
  10291.   Unmounts the volumes in drives 1 (the internal drive) and 2 (the
  10292.   external drive). (The command Eject 1 2 would unmount and eject the
  10293.   volumes.)
  10294.  
  10295.  
  10296.                              See also 
  10297.  
  10298.   Eject and Mount commands.
  10299.  
  10300. æKY UnmountProject
  10301. æC                 UnmountProject -- unmount projects
  10302.  
  10303. UnmountProject -a | Project…
  10304.  -a                      # unmount all mounted projects
  10305.  
  10306. Status codes returned:
  10307.   0    No errors.
  10308.   1    Syntax error.
  10309.   2    Error in processing.
  10310.   3    System error.
  10311.  
  10312.                            Description
  10313.  
  10314.   Unmount projects mounted under Projector.
  10315.  
  10316.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  10317.   symbols used in Projector commands.
  10318.  
  10319.  
  10320.                              Examples
  10321.  
  10322.   To unmount all mounted projects use:
  10323.  
  10324.   UnmountProject -a
  10325.  
  10326.   To unmount the projects MyProject and YourProject use:
  10327.  
  10328.   UnmountProject MyProject YourProject
  10329.  
  10330.  
  10331.                              See also 
  10332.  
  10333.   MountProject.
  10334.  
  10335. æKY Unset
  10336. æC              Unset -- remove Shell variable definitions
  10337.  
  10338. Unset [name…]
  10339.  
  10340. Status codes returned:
  10341.  0    no errors.
  10342.  
  10343.                            Description
  10344.  
  10345.   Removes any variable definition associated with name. (It’s not an
  10346.   error if no definition exists for name.)
  10347.  
  10348.   • Caution If no names are specified, all variable definitions are
  10349.   removed. This can have serious consequences. For example, the Shell
  10350.   uses the variable {Commands} to locate utilities and applications
  10351.   and uses several other variables to set defaults. The assembler and
  10352.   compilers use variables to help locate include files. (For details,
  10353.   see "Variables Defined in the Startup File" in Chapter 5 of the MPW
  10354.   manual.)
  10355.  
  10356.   The scope of the Unset command is limited to the current script;
  10357.   that is, variables in enclosing scripts are not affected.
  10358.  
  10359.  
  10360.                              Examples
  10361.  
  10362.   Unset CaseSensitive
  10363.  
  10364.   Removes the variable definition for {CaseSensitive}. This turns off
  10365.   case-sensitive searching for the editing commands.
  10366.  
  10367.  
  10368.                              See also 
  10369.  
  10370.   Set, Export, and Unexport commands.
  10371.  
  10372.   "Defining and Redefining Variables" in Chapter 5.
  10373.  
  10374. æKY UserVariables
  10375. æC     UserVariables -- uses Commando to set all the user variables
  10376.  
  10377. æKY Version
  10378. æC                Version -- print the version of the MPW Shell
  10379.  
  10380. æKY VersionList
  10381. æC           VersionList -- print version info from files
  10382.  
  10383. VersionList [option…] [file…]  > versionsReport
  10384.  -all                    # print version info for all files in directory
  10385.  -c creator              # report on files that have the named file creator. 
  10386.                          #   Default is 'MPS '
  10387.  -d                      # include modification date in report
  10388.  -h                      # suppress the report header and footer
  10389.  -l                      # don't truncate very long file names
  10390.  -newer date             # report on files whose modification date is 
  10391.                          #   newer than date
  10392.  -older date             # report on files whose modification date is 
  10393.                          #   older than date
  10394.  -p                      # write progress information to diagnostic output
  10395.  -r                      # recursively search subdirectories
  10396.  -raw                    # suppress all formatting.  Print tab-delimited columns
  10397.  -t type                 # report on files that have the named file type. 
  10398.                          #   Default is 'MPST'
  10399.  -u path                 # start search at <path>. Default is {MPW}Tools:
  10400.  -v                      # include 'vers' 2 resource info in report
  10401.  
  10402. Status codes returned:
  10403.   0    No errors.
  10404.   1    Syntax error.
  10405.   2    Error in processing.
  10406.   3    System error.
  10407.   -9   User abort.
  10408.   
  10409.                            Description
  10410.                            
  10411. VersionList lists the version numbers of specified files. If no files are
  10412. specified, VersionList reports on MPW tools in the "{MPW}"Tools:
  10413. directory. It obtains the versions from the files’ “vers” resources.
  10414.  
  10415.                              Examples
  10416.                              
  10417. VersionList -v -d
  10418.  
  10419.  
  10420. # ---------------------------------------------------------------------
  10421. # VersionList Report
  10422. # Report Date: 6/24/91
  10423. # Report Root: "HD:MPW:Tools:"
  10424.  
  10425. # File Name         Version     Release     Modification Date
  10426. # ---------------------------------------------------------------------
  10427.  
  10428.   Asm386            1.0b        1.0b         5/13/91
  10429.   Backup            2.131       3.2          4/23/91
  10430.   BigBrother        1.1a8       1.1a8        6/23/91
  10431.   C                 3.2         3.2          4/ 6/91
  10432.   COptimizer        0.9         n/a          6/24/91
  10433.   Choose            n/a         3.2          4/ 6/91
  10434.   Commando          3.2         3.2          4/17/91
  10435.   Compare           5.1         3.2          4/ 6/91
  10436.   Count             n/a         3.2          4/ 6/91
  10437.   DeRez             3.2         3.2          4/ 6/91
  10438.   DumpObj           3.2         3.2          4/ 6/91
  10439.   GetFileName       n/a         3.2          4/ 6/91
  10440.   GetListItem       3.2         3.2          4/ 6/91
  10441.   Lib               3.2         3.2          4/ 6/91
  10442.   Link              3.2         3.2          4/ 6/91
  10443.   Make              3.2         3.2          4/ 6/91
  10444.   NetSwamp          3.2         3.2          4/ 6/91
  10445.   Print             3.2         3.2          4/ 6/91
  10446.   Progresso         4.4         n/a          2/ 5/91
  10447.   ResEqual          2.1         3.2          4/ 6/91
  10448.   Rez               3.2         3.2          4/ 6/91
  10449.   Search            3.2         3.2          4/ 9/91
  10450.   SetVersion        3.46        3.2          4/ 6/91
  10451.   Sort              n/a         3.2          4/ 6/91
  10452.   SysGen            7.0         7.0          5/13/91
  10453.   ThisIsAVeryLong…  n/a         3.2          4/ 6/91
  10454.  
  10455. # ---------------------------------------------------------------------
  10456. # 26 files were found matching your description.
  10457. # A total of 26 files were found.
  10458. # ---------------------------------------------------------------------
  10459.  
  10460.  
  10461. VersionList -d  -r -v -newer 5/1/91
  10462.  
  10463.  
  10464. # ---------------------------------------------------------------------
  10465. # VersionList Report
  10466. # Report Date: 6/24/91
  10467. # Report Root: "HD:MPW:Tools:"
  10468.  
  10469. # File Name         Version     Release     Modification Date
  10470. # ---------------------------------------------------------------------
  10471.  
  10472.   Asm386            1.0b        1.0b         5/13/91
  10473.   BigBrother        1.1a8       1.1a8        6/23/91
  10474.   COptimizer        0.9         n/a          6/24/91
  10475.   SysGen            7.0         7.0          5/13/91
  10476.  
  10477. # ---------------------------------------------------------------------
  10478. # 4 files were found matching your description.
  10479. # A total of 26 files were found.
  10480. # ---------------------------------------------------------------------
  10481.                             
  10482. æKY Volumes
  10483. æC                   Volumes -- list mounted volumes
  10484.  
  10485. Volumes [-l] [-q] [volume…]  > volumeList
  10486.  -l                      # long format (name, drive, size, free, files, dirs)
  10487.  -q                      # don't quote volume names with special characters
  10488.  
  10489. Status codes returned:
  10490.   0    No errors.
  10491.   1    Syntax error.
  10492.   2    No such volume.
  10493.  
  10494.                            Description
  10495.  
  10496.   For each volume named, Volumes writes its name and any other information
  10497.   requested to standard output. The output is sorted alphabetically.
  10498.   A volume name must end with a colon ( : )—if volume is a number without
  10499.   a colon, it’s interpreted as a disk drive number. If volume is not
  10500.   given, all mounted volumes are listed.
  10501.  
  10502.  
  10503.                              Examples
  10504.  
  10505.   Volumes -l
  10506.  
  10507.   will write information such as
  10508.  
  10509.   Name   Drive   Size    Free   Files  Dirs
  10510.   _____ ______  _____   _____  ______ _____
  10511.   HD:      3    19171K  14242K    290   33
  10512.  
  10513.   Files `Volumes 1`
  10514.  
  10515.   Lists the files on the disk in drive 1 (the built-in 3.5-inch disk
  10516.   drive).
  10517.  
  10518. æKY WhereIs
  10519. æC               WhereIs  -- find the location of a file
  10520.  
  10521. WhereIs [-c] [-d] [-v] [-s directory]… pattern
  10522.  -c                      # completely match filepattern
  10523.  -d                      # include directories
  10524.  -v                      # verbose output - put summary line at end
  10525.  -s directory            # starting directory/volume for search
  10526.  
  10527. Status codes returned:
  10528.   0    No errors.
  10529.   1    Syntax error.
  10530.   2    File system error during processing.
  10531.   3    No matches were found.
  10532.  
  10533.                            Description
  10534.  
  10535.   Use WhereIs to find the location of all files that contain pattern
  10536.   as part of their filename. You can use WhereIs to find files hidden
  10537.   in the directory tree. Pattern is a full or partial filename. For
  10538.   example, a pattern of "test" will match TestProg.c, test.c, and Work:OutputTest.
  10539.   WhereIs starts searching in the root directory of the default volume
  10540.   and searches the entire disk. To constrain the search to a portion
  10541.   of a disk, or to specify different disks or multiple disks, use the
  10542.   -s option. To list any directories that contain pattern, use the
  10543.   -d option. To constrain the search to files that completely match
  10544.   pattern, use the -c option. The -v option prints the number of items
  10545.   matched with pattern. Matching is not case sensitive, and regular
  10546.   expressions are not supported.
  10547.  
  10548.   WhereIs lists the full pathname of all files and directories found.
  10549.   Files that contain special characters are quoted.
  10550.  
  10551.  
  10552.                              Examples
  10553.  
  10554.   WhereIs test
  10555.  
  10556.   Find all files that have "test" in their filename. The output would
  10557.   be something like
  10558.  
  10559.   HD:MPW:test.c
  10560.   HD:MPW:test.c.o
  10561.   HD:MPW:TestMenu.c
  10562.   HD:MPW:TestProg.p
  10563.  
  10564.   WhereIs -c test.c
  10565.  
  10566.   Find files named test.c. The output (with the same files as the example
  10567.   above) would be
  10568.  
  10569.   HD:MPW:test.c
  10570.  
  10571.   WhereIs -d test
  10572.  
  10573.   Find all files or directories that have "test" in their leafname.
  10574.   The output would be
  10575.  
  10576.   HD:MPW:TestDir:
  10577.   HD:MPW:test.c
  10578.   HD:MPW:test.c.o
  10579.   HD:MPW:TestMenu.c
  10580.   HD:MPW:TestProg.p
  10581.  
  10582.   WhereIs -s HD:MPW -s Disk2:Work test
  10583.  
  10584.   Find all files that have "test" in their pathname. Search for the
  10585.   files starting in HD:MPW and also in Disk2:Work.
  10586.  
  10587. æKY Which
  10588. æC         Which -- determine which file the shell will execute
  10589.  
  10590. Which [-a] [-p] [name]  > file ≥ progress
  10591.  -a                      # report all commands named "name"
  10592.  -p                      # writes progress information to diagnostics
  10593.  
  10594. Status codes returned:
  10595.   0    No error.
  10596.   1    Syntax error.
  10597.   2    Command not found.
  10598.   3    Other error.
  10599.  
  10600.                            Description
  10601.  
  10602.   Determines which command the Shell will execute when command is entered.
  10603.   Which looks for commands defined by aliases, Shell built-in commands,
  10604.   and commands accessible through the Shell variable {Commands} (the
  10605.   same order the Shell uses). If command is not specified, all paths
  10606.   in the {Commands} variable will be written to standard output, one
  10607.   directory per line. The directories are listed in the order in which
  10608.   the Shell would search for commands. In this case the -a and -p options
  10609.   have no meaning.
  10610.  
  10611.  
  10612.                              Examples
  10613.  
  10614.   Which asm
  10615.  
  10616.   This command outputs something like - HD:MPW:Tools:asm. The Shell
  10617.   then executes hd:MPW:Tools:asm when given asm.
  10618.  
  10619.   Which -a makeit
  10620.   Alias makeit 'make > tmp; tmp'
  10621.   HD:MPW:Tools:makeit
  10622.   HD:MPW:Scripts:makeit
  10623.  
  10624.   In this case, there are three different "makeit" commands that the
  10625.   Shell could execute, as determined by current aliases and the {Commands}
  10626.   variable. The Shell executes the first one found (the alias).
  10627.  
  10628.   Which newfolder
  10629.  
  10630.   newfolder
  10631.  
  10632.   In this case, newfolder is a Shell built-in command.
  10633.  
  10634. æKY Windows
  10635. æC                      Windows  -- list windows
  10636.  
  10637. Windows [-q]
  10638.  -q                      # don't quote window names with special characters
  10639.  -o                      # list "Open" command lines for execution
  10640.  
  10641. Status codes returned:
  10642.   0    No error.
  10643.   1    Syntax error.
  10644.  
  10645.                            Description
  10646.  
  10647.   Writes the full pathname of each file currently in a window. The
  10648.   names are written to standard output, one per line, from backmost
  10649.   to frontmost.
  10650.  
  10651.  
  10652.                              Examples
  10653.  
  10654.   Windows
  10655.  
  10656.   Lists the pathnames of all open windows.
  10657.  
  10658.   Print {PrintOptions} `Windows`
  10659.  
  10660.   Prints the pathnames of the open windows, using the options specified
  10661.   by the {PrintOptions} variable. This example uses command substitution:
  10662.   Because the Windows command appears in backquotes (`…`), its output
  10663.   supplies the parameters to the Print command.
  10664.  
  10665.   Echo "Open `Windows` || Set Status 0" > SavedWindows
  10666.  
  10667.   Writes a script in the file SavedWindows that will reopen the current
  10668.   set of open windows. Notice how Echo is used to create the script.
  10669.   The conditional || execution operator restores the status to zero
  10670.   should an error occur while opening the remembered windows. This
  10671.   technique is used in the script Suspend to save the list of open
  10672.   windows.
  10673.  
  10674. æKY ZoomWindow
  10675. æC           ZoomWindow -- enlarge or reduce a window's size
  10676.  
  10677. ZoomWindow [-b | -s] [window]
  10678.  -b                      # zoom to full screen (big)
  10679.  -s                      # zoom back to regular size (small)
  10680.  
  10681. Status codes returned:
  10682.   0    No errors.
  10683.   1    Syntax error (error in parameters).
  10684.   2    The specified window does not exist.
  10685.  
  10686.                            Description
  10687.  
  10688.   Zooms the specified window according to the option specified. The
  10689.   default window is the target (second from the front) window; a specific
  10690.   window can optionally be specified. The -s option forces the window
  10691.   to zoom back to its small size. The -b option forces the window to
  10692.   zoom to its full size. If no option is specified, the window toggles
  10693.   to the other size. ZoomWindow without any options mimics the operation
  10694.   of clicking in the window’s zoom box. This command is especially
  10695.   valuable when used in conjunction with StackWindows or TileWindows.
  10696.  
  10697.                              Examples
  10698.  
  10699.   ZoomWindow
  10700.  
  10701.   Zooms the target window to full screen size if the window was originally
  10702.   in the small size.
  10703.  
  10704.   ZoomWindow -s {Worksheet}
  10705.  
  10706.   Zooms the Worksheet window back to its small size.
  10707.  
  10708.  
  10709.                              See also 
  10710.  
  10711.   MoveWindow, RotateWindows, SizeWindow, StackWindows, and TileWindows
  10712.   commands.
  10713.  
  10714.   {ZoomWindowRect} variable in Chapter 5.
  10715.  
  10716.   The "full size" window is normally the entire screen. You can change
  10717.   it (for example, prevent it from covering the disk and trash icons)
  10718.   by specifying a rectangle in the Shell variable {ZoomWindowRect}.
  10719.